change Event

noun

say it: “CHAYNJ ih-VENT” /tʃeɪndʒ ɪˈvɛnt/

The event a form field fires once its value has changed, such as a new choice in a drop-down.

What is change Event in JavaScript?

change Event — The event a form field fires once its value has changed: when a text box loses focus after an edit, or straight away for a checkbox, radio button or drop-down. To react to every key press, listen for input instead.

document.getElementById("size").addEventListener("change", event => {
  console.log("Size:", event.target.value);
});

In a sentence

  • “The change event updates the price when a new size is picked.”

Level: Apprentice · More JavaScript terms at this level

Updated