JavaScript · Junior · Question 42 of 75
What is event bubbling?
- ✓Correct answer: The event fires on the element and then rises through its ancestors up to
document - 2The event fires on
documentfirst and then descends to the element - 3The event fires on all elements of the page at the same time
Explanation
A click on a button inside a div triggers the button's handlers, then the div's, then higher. Before bubbling there's the capturing phase - from window down to the target. event.target is where the event happened, event.currentTarget is whose handler is running now.