Favorites

DOM HTMLElement: change event

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
HTMLElement: change event
DOM HTMLElement EventThis event is supported by all modern browsers.
Updated 28th November 2026

The change event fires when the user commits a change to a form control, such as ticking a checkbox, choosing an option or leaving a text field after editing it.

Description

The change event fires when the user commits a change to a form control. For checkboxes, radio buttons, <select> and file inputs that's immediately; for text fields it's when the field loses focus after its value changed. Use input instead when you need to react to every keystroke.

For text fields, change doesn't fire on every keystroke, which makes it good for actions that should happen once the user has finished editing, such as saving a setting or validating a field. Changing a value from script doesn't fire it.

It bubbles, so a single listener on a common ancestor, such as a form or the document, can handle it for many elements, using event.target to tell them apart.

Syntax

element.addEventListener('change', handler)

Example

<select id="size">
  <option>Small</option>
  <option>Medium</option>
  <option>Large</option>
</select>
<label><input type="checkbox" id="gift"> Gift wrap</label>
const size = document.getElementById('size');
size.addEventListener('change', () => console.log('Chosen:', size.value));
document.getElementById('gift').addEventListener('change', e => console.log('Gift wrap:', e.target.checked));

Browser Support

The following information will show you the current browser support for the HTMLElement: change event event. Hover over a browser icon to see the version that first introduced support for this event.

This event is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee