Javascript examples for DOM HTML Element:Input Reset
The Input Reset object represents an HTML <input> element with type="reset".
You can access an <input> element with type="reset" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="reset" id="myReset" value="Reset the form"> <button onclick="myFunction()">get the text displayed on the reset button</button> <p id="demo"></p> <script> function myFunction() {// ww w . ja va2s .c om var x = document.getElementById("myReset").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>