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

HTML DOM selectedIndex 屬性

定義和用法

selectedIndex 屬性可設(shè)置或返回下拉列表中被選選項(xiàng)的索引號(hào)。

注釋:若允許多重選擇,則僅會(huì)返回第一個(gè)被選選項(xiàng)的索引號(hào)。

語法

selectObject.selectedIndex=number

實(shí)例

下面的例子可提示出被選選項(xiàng)的索引號(hào):

<html>
<head>
<script type="text/javascript">
function getIndex()
  {
  var x=document.getElementById("mySelect")
  alert(x.selectedIndex)
  }
</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="getIndex()"
value="Alert index of selected option">
</form>

</body>
</html>