# 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.

```javascript
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](https://www.ask-codey.com/glossary?category=javascript&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/event-listener
