As you know, events usually bubble up in javascript, so the event handler of the element that fires the event is executed first, then the event handler of the parent element is
Reverse event bubbling is called capture phase.
See the DOM event architecture
Pass true
as the 3rd argument to Event.addEventListener
to have it trigger on capture phase
el.addEventListener("click", function () {
console.log("i run in capture");
}, true);
Of course it won't work in legacy platforms. You'll need a DOM3 events shim to emulate the event system. Feel free to contribute to the DOM-shim