Event Listener
noun
say it: “ih-VENT LIS-un-er” /ɪˈvɛnt ˈlɪsənər/
A function attached to an element that runs whenever a particular event happens on it.
What is Event Listener in JavaScript?
Event Listener — A callback registered to run when a particular event occurs.
button.addEventListener("click", event => {
const clickedButton = event.target;
});
In a sentence
- “The event listener on the button adds the product to the cart.”
Level: Journeyman · More JavaScript terms at this level
Updated