Originally Posted by mrhoo
If you use onclick with a div, be aware that clicks bubble- you will be handling clicks from any child nodes in the div as well as from the div.
That's for IE. In old Mozilla model events are capturing (from parent to child) not bubbling (from child to parent). W3C standard model says now that there are 2 phases: first the capturing, and when the event reaches the "bottom", the bubbling phase is starting backwards
So that, yes, events can be stopped, but in the bubbling phase:
var e = e||window.event;
e.cancelBubble = true;//IE model
if (e.stopPropagation) e.stopPropagation();//W3C model