Wie unten gezeigt:
Kopieren Sie den Code -Code wie folgt:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" /> />
<title> Nicht -Title -Dokument </title>
<script type = "text/javaScript">
Fuktion selchange () {
var sel = document.getElementById ('sel');
alert (sel.options [sel.selectex] .Text); Text);
alert (sel.options [sel.Selectex]. Wert);
}
</script>
</head>
<body>
<select id = "sel" onchange = "selchange ()">
<Option Value = "Zhangsan"> Zhang san </option>
<Option value = "lisi"> li si </option>
<Option Value = "Wangwu"> Wang Wu </Option>
</select>
</body>
</html>