liveBook · Manning

Event capturing

Event capturing is the phase of DOM event propagation in which an event travels from outer ancestors toward its target.

How 2 Manning books explain it

Secrets of the JavaScript Ninja, Second Edition

The phase of DOM event dispatch in which an event travels down the hierarchy toward its target.

How it is used
Uses capturing to control handler order when a DOM event propagates through nested elements.
How deep it goes
Explains both propagation phases and the addEventListener Boolean setting through nested click handlers, without descending into browser internals.
Examples
Compares click handlers on nested elements and document, including listeners registered for different propagation phases.
What you can do after
Operate/configure it with addEventListener’s third Boolean argument to select capturing instead of default bubbling.

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

React Quickly, Second Edition

The capture phase is the stage in event propagation during which an event travels from an outer target toward its originating target.

How it is used
Coordinates event handling when an application must observe interactions while they travel toward their originating elements.
How deep it goes
Defines propagation order and capture-listener registration, then defers React-specific differences to later treatment.
Examples
Uses a clicked button, ancestor traversal, addEventListener, capture: true, and eventPhase as concrete teaching artifacts.
What you can do after
Apply it via JavaScript addEventListener by registering callbacks specifically for the capture phase.

Read how React Quickly, Second Edition explains event capturing →

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.