<html>
<head>
<script>
function getIndex()
{
var x=document.getElementById("mySelect");
alert(x.selectedIndex);
}
</script>
</head>
<body>
<form>
你喜欢的水果是:
<select id="mySelect">
<option>Apple</option>
<option>Orange</option>
<option>Pineapple</option>
<option>Banana</option>
</select>
<br><br>
<input type="button" onclick="getIndex()" value="弹出选中项">
</form>
</body>
</html>