KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What's a jQuery like and/or best practices way of getting the original target of an event in jQuery (or in browser javascript in general). I've been using something like this $('body').bind('click', function(e){ //depending on the browser, either srcElement or //originalTarget will be populated with the first //element that intercepted the click before it bubbled up var originalElement = e.srcElement; if(!originalElement){originalElement=e.originalTarget;} }); which works, but I'm not pleased with the two line feature sniffing. Is there a better way?
Tags (comma-separated)
Save Edits
Cancel