This is for e.target . You can add an event listener anywhere, until the click event can go to it (which happens by default), you can catch it. Basic example:
document.addEventListener('click', function(e) { alert(e.target.id); });
Clicking on each of them will warn its identifier. Hope this helps :)
<button id="foo">foo</button> <button id="bar">bar</button> <button id="baz">baz</button>
EDIT
http://jsfiddle.net/95NZ8/
Darragh enright
source share