亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

HTML DOM index 屬性

定義和用法

index 屬性可返回下拉列表中選項的索引位置。

語法

optionObject.index

實例

本例可返回下拉列表中所選的選項的索引位置:

<<html>
<head>
<script type="text/javascript">
function alertIndex()
{
var x=document.getElementById("mySelect").selectedIndex;
var y=document.getElementsByTagName("option");
alert(y[x].text + " has the index of: " + y[x].index);
}
</script>
</head>
<body>

<form>
Select your favorite fruit:
<select id="mySelect">
  <option>Apple</option>
  <option>Orange</option>
  <option>Pineapple</option>
  <option>Banana</option>
</select>
<br />
<br />
<input type="button" onclick="alertIndex()"
value="Show index of the chosen fruit">
</form>

</body>
</html>