Javascript examples for DOM Event:Element Event Attribute
The onreset event occurs when a form is reset.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Supported HTML tags: | <form> |
<!DOCTYPE html> <html> <body> <form id="myForm"> Enter name: <input type="text"> <input type="reset"> </form>//from w ww . ja va 2s . c om <p id="demo"></p> <script> document.getElementById("myForm").onreset = function() {myFunction()}; function myFunction() { document.getElementById("demo").innerHTML = "The form was reset"; } </script> </body> </html>