Event capturing is the first stage of event propagation. An event travels from the window through each ancestor toward its originating target before the target and bubble phases run. section 8.3.1
Propagation proceeds through three stages:
- Capture phase: dispatches the event from the window through ancestors, ending at the target’s parent. section 8.3.1
- Target phase: dispatches the event on the originating element. section 8.3.1
- Bubble phase: dispatches the event back upward through the ancestors toward the window. section 8.3.1
Registering a capture listener
Use addEventListener with a third argument containing capture: true: element.addEventListener("click", onClick, { capture: true }); The event object’s eventPhase property identifies the current phase. section 8.3.1
Figure 8.7 When you click the black button, the browser will start propagating events throughout the nodes in the document starting at the window, moving down through the document tree in the capture phase until the target, and then moving back up the tree in the bubbling phase until it reaches the window.
Trace a click from the window down to the button during capture, then back upward during bubbling. section 8.3.1

