Q19: What is Event Bubbling and Event Capturing in the DOM?

DOM event propagation has 3 phases: 1) Capturing Phase (event travels down from document root to target), 2) Target Phase (event reaches target node), 3) Bubbling Phase (event bubbles up from target to document root). addEventListener defaults to handling events in the bubbling phase.

Key Takeaways
  • Capturing travels downward; Bubbling travels upward.
  • Passing { capture: true } attaches listeners to capturing phase.
Knowledge Check

Which method stops an event from propagating further up or down the DOM tree?