DEV Community

Discussion on: Introduction to JavaScript Event Handlers

Collapse
 
drmaquino profile image
Mariano Aquino • Edited

Is there any priority or rule to know whether a click on a DOM element will trigger the most inner children or the most outer grandparent? And another question, how would you handle the case where you want only a specific element to handle a particular event? For instance, the parent, but not the child nor the grandparent.
Thanks!!

Collapse
 
aumayeung profile image
John Au-Yeung

Bubbling will go from child to parent and capturing is the other way around.