JavaScript

Event Listener

Definition

A function attached to a DOM element that executes when a specific event (click, keypress, submit, etc.) occurs on that element. Added with `addEventListener` and removed with `removeEventListener`.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms