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>