JavaScript · Junior · Question 42 of 75

What is event bubbling?

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.

Further reading

Problem with a question

JavaScript · Junior · question 42

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz