[whatwg] getElementsByIdPart

Jim Ley jim.ley at gmail.com
Sun Aug 22 13:46:16 PDT 2004

On Sat, 21 Aug 2004 19:03:03 +0000 (UTC), Ian Hickson <ian at hixie.ch> wrote:
> You could loop over all the elements and make their class attributes equal
> their ID attributes with underscores changed to spaces quite easily, which
> would then allow you to use the method mentioned above, as well as letting
> you use CSS and other class-based mechanisms.

not really, since class is not a single thing, so it won't map cleanly to ID.
> Does this help, or do you really think a getElementByIdPart() method
> would be better? 

DOM 3 XPath (suitably mangled for HTML) would be much better than
inventing lots of extra DOM methods.  especially ones that rely on
regexp matching to degrade in older UA's.


More information about the whatwg mailing list