0Pricing
HTML Academy · Lesson

Form Reset Events and State Management

Handle form reset and track field state across user interactions.

The reset Event

Calling form.reset() or clicking <button type="reset"> fires a reset event on the form. Each field reverts to its initial value (the value attribute, or empty for fresh inputs). Listen for the event to react to the reset programmatically.

Default Values

The initial state used by reset is the defaultValue, defaultChecked or defaultSelected property — not the current value. These reflect the value/checked/selected attributes in the HTML, set at parse time and unchanged by user interaction.

All lessons in this course

  1. The FormData API
  2. The Constraint Validation API
  3. reportValidity and setCustomValidity
  4. Form Reset Events and State Management
← Back to HTML Academy