There are three event handling models in javascript; the W3C, Internet Explorer's and Netscape 4's. As per browser war methodology, they are also incompatible.
The Firefox bubbling method starts with the document and propagates down the tree until the element the event occurred on is found. Any handlers attached above the element with the event will have priority. Internet Explorer does the opposite and searches for handlers by going up the tree from the event's source.
Ultimately, this means you can attach an event higher in the div hierarchy than the div you want to listen to for events. This is important when attaching events to a div which may get removed from the DOM due to dhtml requirements. Especially in Internet Explorer as divs and events are separate COM objects and removing a div can leave an event causing a memory leak.

The console.log shows that event object's output in firebug. The code itself is below. I used dojo to abstract out the event handling differences between W3C and IE7.

The event is attached to the div with id=one. Clicking on three, two or one gets caught by the event handler on id=one. In the first screenshot I clicked on the div id=three and it was registered as the target even though the event on id=one caught it. (more)







