[thelist] Accessing event object NS6,ie55,op5

James Aylard webmaster at equilon-mrc.com
Thu Apr 26 15:53:23 CDT 2001


> I'm trying to find the element that caused a mouseover event.  I think
> that I can do that by:

> ie55 : document.event.srcName

    window.event.srcElement [1] (IE 4+)

> ns6 : document.event.target (I've also seen e.target and evt.target!!)

    Not sure about Netscape 6; presumably it conforms to the W3C DOM Level 2
Events recommendation [2], but testing is essential. For Netscape 4.x, check
out Netscape's documentation of the event object [3]. In the latter
variations you cite above, the object has been assigned to a variable, or
passed into a function as an argument. Somewhere else in the code you should
find something like:

var e = event ;


function fnGetEvent(e) {
   // code here

> op5 ?

    From my brief read of Opera docs [4], it looks like Opera 4+ uses the IE
approach (window.event.srcElement), but you'll have to test it.

James Aylard

2. http://www.w3.org/TR/DOM-Level-2-Events/events.html
4. http://www.opera.com/opera5/specs-js.html

More information about the thelist mailing list