[thelist] IE javascript question

Eduardo Kienetz eduardok at gmail.com
Mon Jul 2 13:57:32 CDT 2007


On 7/2/07, Lee Kowalkowski <lee.kowalkowski at googlemail.com> wrote:
> On 02/07/07, Jeffrey Barke <jeffrey.barke at themechanism.com> wrote:
> > Eduardo,
> > > <div id="EX_AATD" class="hiding"><label> <input type="checkbox"
> > > name="EX_AATD">Item 1</label></div>
> > The div has the same id as the checkbox has name. This is bad,
> > because IE returns an element with a name attribute that is equal to
> > the id specified.
>
> Not when using getElement(s)By* it doesn't...
>
> > > But I'm not calling the INPUT by ID, I'm calling the DIV, and
> > > accessing its childNodes[0].childNodes[1] (the INPUT), as shown in
> > > Firebug and working in Firefox.
>
> Firefox will create text nodes for child nodes, IE won't. In IE it'll
> be childNodes[0].childNodes[0] or firstChild.firstChild.
>
> A consistent solution would be tmp.getElementsByTagName('input')[0].

Works perfectly in IE and Firefox :)

Thank you all.

Best regards,

-- 
Eduardo Bacchi Kienetz
LPI Certified - Level 2
http://www.noticiaslinux.com.br/eduardo/



More information about the thelist mailing list