I am developing a website and now am testing in all browsers, I am currently testing in firefox and have found and error when using event.sourceElement?
What i need
function getTarget(obj) {
var targ;
var e=obj;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
return targ;
}
Will return the target for all browsers if you pass it e
from:- http://www.quirksmode.org/js/events_properties.html