du*****@rrb.gov (Ron D) writes:
What is the equivalent of
if (window.event.s rcElement.id == "txt1ST_INIT_NM ")
in Netscape?
In Netscape 6+ (and other W3C DOM 3 Events compliant browsers, as well
as in Nescape 4) the event object is an argument to the event handler
function. In IE, it is a global variabled called "event". So, there is
no direct substitute for the above, because you have to add an argument
to the handler function.
I usually start my handlers with :
function (evt) {
evt = evt || window.event; // IE sucks!
Further, the "srcElement " is Microsoft's invention, where the W3C DOM
calls it "target". So I usually follow up with:
var tgt = evt.target || evt.srcElement; // IE sucks!
From here, you can just write:
if (tgt.id == "txt1ST_INIT_NM ") ...
Good luck.
/L 'yes, I write the comments every time too'
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'