Hi,<br><br>I think, the behaviour of getElementById for documents with more same IDs could be specified in HTML5.<br><br>DOM2 Core leaves it undefined: "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."
<br><br>MSDN says about this: "Returns a reference to the first object with the specified value of the ID attribute." <a href="http://msdn2.microsoft.com/en-us/library/ms536437.aspx">http://msdn2.microsoft.com/en-us/library/ms536437.aspx
</a><br><br>Seems for me browsers are doing same as MSDN for static pages, and this is probably the logical behaviour.<br><br>I have even heard it returns the htmlcolection in some library, which sounds confusing.<br><br>
Martin Hassman<br><br>