[whatwg] getElementsByIdPart

Jim Ley jim.ley at gmail.com
Sun Aug 29 01:47:57 PDT 2004

On Sat, 28 Aug 2004 20:23:38 -0500, Doron Rosenberg <doronr at gmail.com> wrote:
> People keep asking about getElementsBy{Something}, so having a
> getElementsByAttribute (I believe Mozilla's XBL impl has a similar
> beast) would cover all those requests.

The problem with getElementsByAttribute is that it doesn't help with
ByClassName etc. - the various CSS selection methods people are asking
for, because it needs to act on part of the attribute, not the whole
one.  (by idPart is imo completely wrong, Classes are the correct way
in HTML to group elements into common things)

I personally think simple DOM XPath would also address that - I
realise Opera currently feels this is impractical on mobile because it
would make the codebase larger than current, but other people have
started to show very small (if not fast) implementations of XPath, and
I don't think it would be unreasonable to for now just say do XPath,
then after implementation feedback, if it's proven to be a problem, to
look at simpler methods like these.

Especially as other browser technologies will likely be requiring DOM
XPath, the vendors are likely going to have to implement it anyway,
and if that's the case, all we're doing is duplicating the amount of
methods that do almost identical things.


More information about the whatwg mailing list