[whatwg] getElementById and more same IDs

Hi,

I think, the behaviour of getElementById for documents with more same IDs
could be specified in HTML5.

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

MSDN says about this: "Returns a reference to the first object with the
specified value of the ID attribute."
http://msdn2.microsoft.com/en-us/library/ms536437.aspx

Seems for me browsers are doing same as MSDN for static pages, and this is
probably the logical behaviour.

I have even heard it returns the htmlcolection in some library, which sounds
confusing.

Martin Hassman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070628/aa0c8904/attachment.htm>

Received on Thursday, 28 June 2007 01:42:39 UTC