id 属性可设置或返回单选按钮的 id。
radioObject.id=id
下面的例子可提示出单选按钮的 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>