what is event bubbling? How does event bubbles up? In this post, I'll explain how event bubbling happens and how to achieve event bubbling with JavaScript and jQuery using event delegation.
event bubbling in Javascript explained.

#batman#dc#dc comics#bruce wayne#dick grayson#tim drake#dc fanart#batfamily#batfam

seen from Singapore
seen from Canada

seen from Japan
seen from United States

seen from United States
seen from United States
seen from Russia

seen from Türkiye

seen from Türkiye
seen from China

seen from United States
seen from Türkiye
seen from China
seen from Malaysia
seen from China

seen from United States
seen from China
seen from Germany
seen from France
seen from United States
what is event bubbling? How does event bubbles up? In this post, I'll explain how event bubbling happens and how to achieve event bubbling with JavaScript and jQuery using event delegation.
event bubbling in Javascript explained.
Event Bubbling
No, this does not involve a glass item and a plant named "OG". This is how browsers handle events, most commonly clicks, when nested in parent elements.
Here's an example:
var e1 = document.getElementById("e1"); var e2 = document.getElementById("e2");
// TRUE = TOP => DOWN (CAPTURING) // FALSE = DOWN => UP (BUBBLING) e1.addEventListener('click', doSomething1, false); e2.addEventListener('click', doSomething2, false);
function doSomething1() { console.log(this.id); }
function doSomething2(e) { alert(this.id); e.stopPropagation(); }
The stopPropagation function prevents bubbling from happening up the hierarchy. Conversely, changing the event listener on e1 from "false" to "true", would trigger a top-down approach, bypassing e.stopPropagation() altogether!
Potent stuff.