Como se muestra a continuación:
Copiar código del código de la siguiente manera:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<Evista>
<meta http-oquiv = "content-type" content = "text /html; charset = utf-8" /> />
<title> Documento no -tito </title>
<script type = "text/javaScript">
fuinction selchange () {
var sel = document.getElementById ('sel');
alert (sel.options [sel.selectex] .Text); text);
alerta (sel.options [sel.selectex]. valor);
}
</script>
</ablo>
<Body>
<select id = "sel" onchange = "selchange ()">
<opción valor = "zhangsan"> zhang san </opción>
<opción valor = "lisi"> li si </ppection>
<opción valor = "wangwu"> wang wu </opción>
</select>
</body>
</html>