DOCUMENT / 文档

HTML DOM Reset type 属性

HTML DOM Reset type 属性

Reset type 属性

Reset 对象

定义和用法

type 属性可返回重置按钮的表单元素类型。

对于确认按钮,该属性总是 "reset"。

语法

resetObject.type

浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 type 属性

实例

实例

下面的例子可返回重置按钮的表单元素类型:

<html>

<head>

<script>

function displayResult()

{

var x=document.getElementById("reset1").type;

alert(x);

}

</script>

</head>

<body>


<form>

Email: <input type="text" id="email">

<input type="reset" id="reset1">

</form>


<button type="button" onclick="displayResult()">Display input type</button>


</body>

</html>
尝试一下 »

Reset 对象