[thelist] IE javascript question

Jeffrey Barke jeffrey.barke at themechanism.com
Mon Jul 2 14:50:55 CDT 2007


Lee,

>>> <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...

Possibly I wasn't clear and maybe I'm misunderstanding you, but  
document.getElementById may return an element with a name attribute  
equal to the id specified in IE and Opera.
See <http://www.quirksmode.org/bugreports/archives/2005/09/ 
documentgetElementById_may_return_element_with_a_n.html>
and <http://www.csb7.com/test/ie_getelementbyid_bug/index.php>

Jeffrey

--
Cheers.
Jeffrey Barke
jeffery.barke at theMechanism.com
Lead Developer, US
theMechanism - New York City
440 9th Avenue, 8th Floor
New York, NY 10001-1631
t: +1 212.404.3150
c: +1 917.941.1232
f: +1 212.404.3228



http://www.theMechanism.com

Subscribe to theMechcast, our monthly Podcast:
http://feeds.feedburner.com/theMechcast

theMechanism - London
3rd Floor
405 The Strand
London E14 9FW
United Kingdom
t: +44 (0)20 7240 4942
f: +44 (0)20 7240 2262

--
The information contained in this Electronic mail message is attorney  
privileged and confidential information intended only for the use of  
the individual or entity named above. Such information also is  
intended to be privileged, confidential, and exempt from disclosure  
under applicable law. If the reader of this message is not the  
intended recipient or the employee or agent responsible to deliver it  
to the intended recipient, you are hereby notified that any  
dissemination, distribution, or copying of this communication is  
strictly prohibited. If you have received this communication in  
error, please notify us immediately by telephone.

Blah, blah, blah...
--


On Jul 2, 2007, at 2:24 PM, Lee Kowalkowski 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].
>
> -- 
> Lee
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !




More information about the thelist mailing list