Reset typeProperty

Reset 对象参考手册Reset Object

Definition and Usage

The type property returns the form element type of the reset button.

For a reset button, this property is always "reset".

Syntax

resetObject.type


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type property


Examples

Examples

The following example returns the form element type of the reset button:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial (example.com)</title>
<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()">Show input type</button>

</body>
</html>

Try it yourself »


Reset 对象参考手册Reset Object Other Extensions