type 属性可返回单选按钮的表单元素类型。对于单选按钮,该属性总是 "radio"。
radioObject.type
下面的例子可返回单选按钮的表单元素类型:
<html>
<body>
<form>
<input type="radio" id="radio1" />
</form>
<script type="text/javascript">
x=document.getElementById("radio1");
document.write("Form element type is: ");
document.write(x.type
);
</script>
</body>
</html>