DOM HTMLElement: change event
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
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.
Desktop





Tablets & Mobile





