Input Reset type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Reset

Description

The type property returns the type of form reset button.

For a reset button object, this property will always return "reset".

Return Value

Type Description
String The type of form element the reset button is

The following code shows how to check which type of form element the Reset button is:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {//from   w w w  .  j a v a 2  s  . c om
    var x = document.getElementById("myReset").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials