HTML onreset Event Attribute Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The onreset event attribute in HTML is triggered when reset the form. This Attribute works with form tag and is triggered when a form is reset, either by user action or programmatically. It also allows the execution of scripts or functions to handle actions after form reset. Syntax:<form onreset = "script">Supported Tags: <form>Attribute Value:This attribute contains a single value script that works when onreset event call. Example 1:In this example, we will see the implementation of onreset tag. html <!DOCTYPE html> <html> <head> <title>onreset event attribute</title> <style> body { text-align: center; } h1 { color: green; } </style> <script> function Geeks() { alert("Form Reset..."); } </script> </head> <body> <h1> GeeksforGeeks </h1> <h2> onreset event attribute </h2> <form onreset="Geeks()" style="color:blue" ;> First Name: <input type="text"></br> Last Name: <input type="text"></br> <input type="reset"> </form> </body> </html> Output: OutputExample 2: In this example, we will see the implementation of onreset tag. HTML <!DOCTYPE html> <html> <body> <center> <h1 style="color: green;">GeeksforGeeks</h1> <h3 style="color:orange;font-weight:bold;"> Form Reset Example </h3> <form onreset="resetMessage()"> <label for="inputField">Enter Text:</label> <input type="text" id="inputField"> <br> <button type="reset" style="margin-top: 10px;"> Reset Form </button> </form> <p id="resetInfo"></p> <script> function resetMessage() { document.getElementById("resetInfo"). innerHTML = "Form has been reset!"; } </script> </center> </body> </html> Output: OutputSupported Browser: Google Chrome 1 and aboveEdge 12 and aboveFirefox 6 and aboveOpera 12.1 and aboveSafari 3 and above Create Quiz Comment R R_Raj Follow 0 Improve R R_Raj Follow 0 Improve Article Tags : Web Technologies HTML HTML-Attributes Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like