jargon

Frontend & browser·JavaScript in the browser

you clicked the button and the click handler on its container ran too, without you binding anything there.

Event bubbling

Also calledbubble phase, propagation

The second phase of event dispatch, in which the event travels from the target back up through every ancestor to the document, firing listeners at each. It is the default phase for `addEventListener`, and it is what makes a single handler on a container able to serve every descendant. It is also why a click inside a modal can close the dropdown behind it, unless something stops the propagation.

Commonly confused with