<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script>
function see() {
var o = document.getElementById("a").options;
var myValue = document.getElementById("myValue").value;
for(var i = 0; i < o.length; i++) {
if (o[i].value == myValue) alert(i);
}
}
</script>
</head>
<body>
<select id="a">
<option value=1>aaa</option>
<option value=2>bbb</option>
<option value=3>ccc</option>
<option value=4>ddd</option>
<option value=5>eee</option>
</select><br/>
Input your value:
<input type="text" id="myValue" /><br/>
<input type="button" value="see index" onclick="see();"/>
</body>
</html>
输入你知道的value值,再点按钮就能看到index了。但是你想这样做什么呢?