[whatwg] getElementById and more same IDs
martin.hassman at gmail.com
Thu Jun 28 01:42:39 PDT 2007
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."
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg