Event Phases (capture/bubble) Playground

One click on your HTML carried down and back up the teacher’s board: every element has a capture and a bubble listener that can log or stop, and the replay…

Why it matters

This is the base of event delegation, the answer to "why does the button click also trigger the card’s handler", and of clicks that punch through a modal. Knowing capture vs bubble and what stopPropagation does gives you correct handlers, not guesswork.

The key idea

An event travels both ways: capture down, then bubble up

Common mistakes

Try it in this playground