Javascript examples for DOM HTML Element:Input Reset
The type property returns the type of form reset button.
For a reset button object, this property will always return "reset".
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:
<!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>