HTML DOM type 屬性
定義和用法
type 屬性可返回確認按鈕的表單元素類型。對于確認按鈕,該屬性總是 "submit"。
語法
submitObject.type
實例
下面的例子可返回確認按鈕的表單元素類型:
<html>
<head>
<script type="text/javascript">
function alertType()
{
alert(document.getElementById("submit1").type
)
}
</script>
</head>
<body>
<form>
<input type="submit" id="submit1" onclick="alertType()" />
</form>
</body>
</html>