Subj : Re: JS onMozilla and using ID tags. To : Chris Arsenault From : Brendan Eich Date : Thu May 06 2004 04:06 pm Chris Arsenault wrote: > If i have a img tag in html that defines an ID attribute, why can't I > refer to it in javascript by that name? This method works in both > Opera and IE, so I was wondering if the syntax was slightly diffrent, > or something along those lines for Mozilla > > > Here's part of the source I'm using. > > > function loadImage() > { > map.src = './imgsrc.png'; > } > ... > > ... > onMouseUp='doEvent()' src=''> You are posting to the wrong group. See headers. The answer is that IE does not conform to any DOM standard in polluting the window object with element identifiers. Use document.getElementById('map'), it works in IE as well as standards-conforming browsers. Any decent DOM book (e.g., Danny Goodman's O'Reilly book) covers this. /be .