+ 2

What is the difference between capturing and bubbling?

Event propagation

25th Mar 2017, 5:28 PM
Kassem Shehady
Kassem Shehady - avatar
2 Respuestas
+ 5
You just captured your own question and bubbled the answer​
25th Mar 2017, 5:36 PM
Meharban Singh
Meharban Singh - avatar
+ 3
There are two ways of event propagation in the HTML DOM: bubbling and capturing. Event propagation allows for the definition of the element order when an event occurs. If you have a <p> element inside a <div> element, and the user clicks on the <p> element, which element's "click" event should be handled first? In bubbling, the innermost element's event is handled first and then the outer element's event is handled. The <p> element's click event is handled first, followed by the <div> element's click event. In capturing, the outermost element's event is handled first and then the inner. The <div> element's click event is handled first, followed by the <p> element's click event
25th Mar 2017, 5:28 PM
Kassem Shehady
Kassem Shehady - avatar