liveBook · Manning

addEventListener

addEventListener is a web API method that registers a callback to run when a specified event occurs on an event target.

How 2 Manning books explain it

React Quickly, Second Edition

addEventListener is a browser API method that registers a function to be invoked for a specified event on an event target.

How it is used
Registers browser-level handlers for window, document, and referenced DOM nodes outside React’s event properties.
How deep it goes
Explains registration, capture options, propagation phases, React effects, state updates, and unmount cleanup.
Examples
Demonstrates click listeners, capture listeners, referenced DOM nodes, and a React window-resize display.
What you can do after
Operate/configure direct browser listeners, select capture behavior, update React state, and remove handlers during unmount.

Read how React Quickly, Second Edition explains addEventListener →

Secrets of the JavaScript Ninja, Second Edition

A DOM method for registering an event listener on an event target without replacing existing listeners for the same event type.

How it is used
Registers browser event handlers so client-side applications can respond to user actions.
How deep it goes
Defines registration, contrasts property assignment, and demonstrates multiple event types; leaves event-processing flow for later.
Examples
Demonstrates body mousemove and click handlers that append labeled messages to a list.
What you can do after
Apply the DOM method to register multiple handlers for specified events.

Read how Secrets of the JavaScript Ninja, Second Edition explains addEventListener →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.