Search⌘ K
AI Features

Solution Review: Event Capturing

Explore event capturing in JavaScript, where events propagate from parent elements down to their children. Understand how this affects event listener execution order by analyzing a button click example with nested elements. This lesson helps you grasp event capturing, essential for frontend interview questions on event handling concepts.

We'll cover the following...

Question: Solution review #

In the previous lesson you had to figure out the console output of the following code upon clicking the button:

Explanation #

Run the code below to see the output:

From the output, you can tell that Option C is the correct answer. Let’s discuss why.

As you can see, every time you click the button, Box is clicked ...