Javascript Reference - HTML DOM Input Reset type Property








The type property gets type string of a reset button.

Browser Support

type Yes Yes Yes Yes Yes

Syntax

var v = resetObject.type 

Return Value

Type Description
String The type string of the reset button is




Example

The following code shows how to get the type string of the Reset button.


<!DOCTYPE html>
<html>
<body>
<!--from ww w .  ja  v  a2  s  .  c  o  m-->
<input type="reset" id="myReset">
<button onclick="myFunction()">test</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myReset").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The code above is rendered as follows: