以下に示すように:
次のようにコードコードをコピーします。
<
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<メタhttp-equiv = "content-type" content = "text /html; charset = utf-8" /> />
<Title>非文書</title>
<script type = "text/javascript">
Fuinction selchange(){
var sel = document.getElementById( 'sel');
alert(sel.options [sel.selectex] .text); text);
アラート(sel.options [sel.selectex]。値);
}
</script>
</head>
<body>
<select id = "sel" onchange = "selchange()">
<オプション値= "Zhangsan"> Zhang San </option>
<オプション値= "lisi"> li si </option>
<オプション値= "wangwu"> wang wu </option>
</select>
</body>
</html>