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
Learn More
Related Terms
A function passed as an argument to another function, to be executed later. Callbacks are the foundation of asynchronous JavaScript and are used extensively in event handling and array methods.
DOMDocument Object Model — a tree-structured representation of an HTML document that allows JavaScript to read and manipulate page content, structure, and styles. Every HTML element becomes a node in the DOM tree.
Event BubblingThe DOM event propagation pattern where an event triggered on a child element propagates upward through its ancestors. This allows event delegation — attaching a single listener to a parent to handle events on its children.