<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html
>
<
head
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=EUC-KR"
>
<
title
>Select Event</
title
>
<
script
type
=
"text/javascript"
>
function selectEvent(selectObj) {
alert(selectObj.value + "가 선택 되었습니다.");
}
</
script
>
</
head
>
<
body
>
<
select
name
=
"select"
onChange
=
"javascript:selectEvent(this)"
>
<
option
value
=
"menu1"
selected>메뉴 1</
option
>
<
option
value
=
"menu2"
>메뉴 2</
option
>
<
option
value
=
"menu3"
>메뉴 3</
option
>
</
select
>
</
body
>
</
html
>
select 태그에서 onChange를 이용하여 자바스크립트 함수를 호출한다.
onChange는 select태그에 값을 선택하게 될때 함수를 호출되도록 한다.