W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: HTML-DOM: getElementById

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 16 Jul 2001 10:44:56 -0400
To: www-dom@w3.org
Message-ID: <OFD01C7334.C6D11D9C-ON85256A8B.00505FA3@pok.ibm.com>

> is getElementById() case-sensitive in the HTML DOM?

Yes. As you pointed out, "user agents must treat it case-sensitive".

>How handle current implementations the case, when an ID isn't unique,
>what do they return for getElementById()?

The DOM doesn't currently check for uniqueness.. DOM Level 3 may address
this. Meanwhile, I'd say that any response to a poorly-formed document is
equally acceptable. Personally I'd lean toward "If it isn't unique, it
isn't really an ID, so none of them match" -- which would be easier to
diagnose and repair than picking one at random. Or move toward the XHTML
world and declare the document invalid -- though there is so much broken
HTML currently in use that this isn't always an option.

Joe Kesselman  / IBM Research
Received on Monday, 16 July 2001 10:45:34 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC