DOM event propagation has a capture phase from ancestors to the target and a bubble phase back to ancestors. A listener registered with the capture option runs on the downward path.
The demo replays the order recorded by real click listeners on nested elements. Keep the phases distinct when using event delegation or stopping propagation.
When to use
Use it to understand listener order when both parent and child handle clicks.