When working in Firefox 6, I encountered an issue while trying to identify the target element on which the event occurred. Instead of displaying the desired element, it was showing as undefined in the alert message. Utilizing the Firebug tool for debugging purposes, I discovered that the attribute "target" was missing from the event object. Can anyone provide assistance with this matter? Below is the code snippet in question:
function getSource(event)
{
if(!event)
{
field = window.event.srcElement;
alert(field);
}
else
{
field = event.target;
alert(field) //Receiving 'undefined' in FF6
}
}
Edited Section:
document.onkeypress = getSource;
document.onmouseup = getSource;
Any guidance or support would be greatly appreciated.