When the form is reset, the onreset attribute will trigger. You can try running the following code to implement the onreset property −
<!DOCTYPE html> <html> <body> <form onreset = "display()"> Student Name:<br> <input type = "text" name = "sname"> <br> Student Subject:<br> <input type = "text" name = "ssubject"> <br> <input type = "reset" value = "reset"> </form> <script> function display() { alert("Form reset successfull!"); } </script> </body> </html>
The above is the detailed content of Execute script when reset button in form is clicked in HTML?. For more information, please follow other related articles on the PHP Chinese website!