HTML onreset Attribute
Example
<form onreset="myFunction()">
Enter name: <input type="text">
<input type="reset">
</form>
<script>
function myFunction() {
alert("The form has been reset");
}
</script>
Meaning
The onreset attribute specifies that the form is being reset, possibly by the click of a reset button.
Standard Syntax
<element onreset="script">
Browser Support
Status
Applies to:
The onreset attribute can be used on the following element:
Attribute Values
Value | Description |
---|---|
script | Specifies the script to be run on onreset. |