[B]The following function gets the target of a mouseover and mouseout event for a dropdown menu:
function getTarget(evt){
// get srcElement if target is falsy (IE)
var targetElement = null;
if (typeof evt.target != “undefined”)
{
targetElement = evt.target;
}
else
{
targetElement = evt.srcElement;
}
//return id of <li> element when hovering over <li> or <a>
if (targetElement.nodeName.toLowerCase() == ‘li’){
return targetElement;
}
else if (targetElement.parentNode.nodeName.toLowerCase() == ‘li’){
return targetElement.parentNode;
}
else{
return targetElement;
}
}// end getTarget
[B]and this is what I do before calling it (from the mouseover and mouseout functions):
// get window.event if argument is falsy (in IE)
evt = evt || window.event;
//get real target
var target = getTarget(evt);
[B]In IE I get the error on this line:
targetElement = evt.srcElement;
[B]and the debugger says “Member not Found”…
Any suggestion? It works in all the other browsers…