Well, yes, srcElement is IE, mozilla uses .target, same object really,
now, you don't need it though, as you're using an event handler on the
actual element explicitly as opposed to binding it through its hierarchy,
so, instead, use:
function enlarge(el) {
el.src=el.src.replace(/thumbs/,'images')
}
onclick="enlarge(this)"
Danny
On Sun, 26 Jun 2005 18:04:35 -0700, LAshooter <lashooter@hotmail.com>
wrote:
[color=blue]
> I'm trying to use a javascript function that works in IE but not in
> Firefox.
> Is there something about this code that is IE specific? If so, can I
> add/alter something to make it work in more browsers?
>
>
> Ex:<img src="thumbs/Dina.jpg" alt="Dina Marie Vannoni" width="39"
> height="50" border="1" onClick="enlarge()"><script language="JavaScript">
> function enlarge() {
> oSrcElem = event.srcElement;
> imgLarge.src = oSrcElem.src.replace(/thumbs/,'images');
> }
> </script>
> Thanx,Wm(replies CC: to sdshooter at hotmail appreciated!)
>
>[/color]
--
Using Opera's revolutionary e-mail client:
http://www.opera.com/mail/