front-end-interview-handbook/packages/quiz/questions/describe-event-bubbling/en-US.mdx

6 lines
357 B
Plaintext

---
title: Describe event bubbling
---
When an event triggers on a DOM element, it will attempt to handle the event if there is a listener attached, then the event is bubbled up to its parent and the same thing happens. This bubbling occurs up the element's ancestors all the way to the `document`. Event bubbling is the mechanism behind event delegation.