最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

HTML DOM id 屬性

定義和用法

id 屬性可設(shè)置或返回下拉列表中選項(xiàng)的 id。

語法

optionObject.id=id

實(shí)例

下面的例子可返回下拉列表中所選選項(xiàng)的 id:

<html>
<head>
<script type="text/javascript">
function alertOptionId()
{
var x=document.getElementById("mySelect").selectedIndex;
alert(document.getElementsByTagName("option")[x].id);
}
</script>
</head>
<body>

<form>
Select your favorite fruit:
<select id="mySelect">
  <option id="apple">Apple</option>
  <option id="orange">Orange</option>
  <option id="pineapple">Pineapple</option>
  <option id="banana">Banana</option>
</select>
<br /><br />
<input type="button" onclick="alertOptionId()" value="Alert id">
</form>

</body>
</html>
连城县| 兴和县| 河东区| 京山县| 青冈县| 当涂县| 克拉玛依市| 深州市| 利津县| 酒泉市| 偏关县| 昌图县| 五常市| 偃师市| 万山特区| 肇州县| 宝应县| 巴东县| 吴川市| 潢川县| 山东省| 商水县| 浦县| 红安县| 安图县| 龙泉市| 四子王旗| 红桥区| 花垣县| 平度市| 玉山县| 休宁县| 平定县| 大埔县| 信阳市| 沁源县| 清远市| 稷山县| 名山县| 九寨沟县| 宁明县|