+ 1
If I click on a div above body element whose click event will be activated?
I have applied click event on both div and body. Whose click event will b activated? Body or div or both?
1 Réponse
+ 10
First body then div ("bubbling", use "addEventListener(event,callback,true)" to change it to "capturing" and thus reverse priority order…or use "stopPropagation()" to make first event deactivate the second…)…