As with all the other event related processing there are two different ways of retrieving the node within the web page that is being processed by the current event - one for Internet Explorer and one for other browsers. Also some browsers will identify the text node that a mouse event specifically interacted with rather than the tag that contains the text.
This function in this example takes each of these things into account and calling the whichElement() function will return a reference to the HTML tag element that the event is interacting with.
whichElement = function(e) {
var targ;
targ = (window.event) ? window.event.srcElement : e.target;
if (3===targ.nodeType) {
targ = targ.parentNode;
}
return targ;
};
