HTML DOM id 屬性
定義和用法
id 屬性可設(shè)置或返回單選按鈕的 id。
語(yǔ)法
radioObject.id=id
實(shí)例
下面的例子可提示出單選按鈕的 id:
<html>
<body>
<form>
<input type="radio" id="radio1" />
</form>
<p>The id of the radio button is:
<script type="text/javascript">
x=document.getElementById('radio1');
document.write(x.id
);
</script>
</p>
</body>
</html>