call(back)

What Is Event Bubbling?

What is event bubbling?

Answer out loud in under a minute: a definition, one concrete example, and one pitfall or trade-off.

Hints

Hint 1

Name the three phases, and one feature that depends on bubbling.

Solution

Show the approach

Answer

An event travels in three phases: capture down from window, the target, then bubble back up. Listeners run in the bubble phase unless registered with { capture: true }. Event delegation, one listener on a parent that handles events for its children, depends on bubbling. focus, blur, mouseenter and mouseleave do not bubble; focusin and focusout are their bubbling twins.

Asked at