That's not a good example anyway. It's invalid because there can only be ONE
unique ID per page.

  _____  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Heimlich
Sent: Tuesday, June 12, 2007 7:32 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: SlickSpeed CSS Selector TestSuite


On 6/12/07, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote: 

Plus, what happens if you have:

<div id="bam" />

<span id="bam" />

What if you need to retrieve the span tag? If it's checking #bam first,
won't it only find the <div /> element? 



The DOM2 has this to say:



getElementById introduced in DOM Level 2 
    Returns the Element whose ID is given by elementId. If no such element
exists, returns null. Behavior is not defined if more than one element has
this ID.   



Source: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId

I would think that the first one the browser finds is selected, but I can't
be certain of that as I've never actually tried to do this. 

-- 
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com 

Reply via email to