Web/API/HTMLFormElement/reset event

From Get docs


The reset event fires when a <form> is reset.

Bubbles Yes (although specified as a simple event that doesn't bubble)
Cancelable Yes
Interface Event
Event handler property GlobalEventHandlers.onreset

Examples

This example uses EventTarget.addEventListener() to listen for form resets, and logs the current Event.timeStamp whenever that occurs.

HTML

<form id="form">
  <label>Test field: <input type="text"></label>
  <br><br>
  <button type="reset">Reset form</button>
</form>
<p id="log"></p>

JavaScript

function logReset(event) {
  log.textContent = `Form reset! Time stamp: ${event.timeStamp}`;
}

const form = document.getElementById('form');
const log = document.getElementById('log');
form.addEventListener('reset', logReset);

Result

Specifications

Specification Status Comment
HTML Living StandardThe definition of 'reset' in that specification. Working Draft No change
HTML 5.2The definition of 'reset' in that specification. Recommendation No change
HTML 5.1The definition of 'reset' in that specification. Recommendation Added info that the event is not trusted.
HTML5The definition of 'reset' in that specification. Recommendation Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
reset event Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support Yes

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support Yes

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support


See also