Form onresetEvent

Form 对象参考手册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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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>

Try it Yourself »


Form 对象参考手册Form Object Other Extensions