HTML onreset Attribute

HTML onreset Attribute: The HTML onreset Attribute is defined as it fires when a form is reset. The onreset attribute is part of the Event attributes and can be used on the <form> element.

HTML onreset Attribute

The HTML onreset attribute can be applied to the <form> element.

Syntax: <element onreset=”script”>

Browser Support:

The HTML onreset attribute is supported by the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Opera
  • Internet Explorer

Example: for <form> element

<!DOCTYPE html>
<form onreset="myFunction()">
  Enter name: <input type="text">
  <input type="reset">
function myFunction() {
  alert("The form was reset");



HTML onreset attribute