Form onresetEvent
Form Object
Definition and Usage
The onreset event is invoked after the reset button is clicked to submit the form.
Syntax
onreset="JavaScriptCode"
| Parameter | Description |
|---|---|
| JavaScriptCode | Required. Specifies the JavaScript code to execute after the event is triggered. |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the onreset event
Examples
Examples
Display a popup when the reset button is clicked:
<form onreset="alert('The form will be reset')">
Firstname: <input type="text" name="fname" value="Donald"><br>
Lastname: <input type="text" name="lname" value="Duck"><br><br>
<input type="reset" value="Reset">
</form>
Firstname: <input type="text" name="fname" value="Donald"><br>
Lastname: <input type="text" name="lname" value="Duck"><br><br>
<input type="reset" value="Reset">
</form>
Try it Yourself »
Form Object Other Extensions