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