Javascript examples for DOM Event:onreset
Display the text that was inserted in a text field before it was reset:
<!DOCTYPE html> <html> <body> <form onreset="myFunction()"> <input type="text" id="myInput"> <input type="reset"> </form>//from ww w .ja v a 2s . co m <script> function myFunction() { var x = document.getElementById("myInput"); console.log("Before reset, the text was: " + x.value); } </script> </body> </html>