HTML DOM type 屬性
定義和用法
type 屬性可返回元素的表單類型。對于一個(gè) checkbox 對象,該屬性總是返回 "checkbox"。
語法
checkboxObject.type
實(shí)例
下面的例子返回了 checkbox 的表單元素類型:
<html>
<body>
<form>
<input type="checkbox" id="check1" />
</form>
<script type="text/javascript">
x=document.getElementById("check1");
document.write("Form element type is: ");
document.write(x.type
);
</script>
</body>
</html>