html5 at zoid.nl
Fri Jul 6 12:24:25 PDT 2007
I'm not sure if this has been proposed yet (can hardly believe it
hasn't). But I couldn't find it in the specs so I just give it a go anyway.
I'd like to see a getElementsByAttr method. It would be quite similar as
the getElementsByClassName method but with an extra argument:
For attributes that can have more than one value (either seperated by
spaces or commas) the value argument may be a space(/comma) seperated
string or an array, similar to getElementsByClassName. If value is not
defined of perhaps a wildcard ("*") the method should return all nodes
that have the particular attribute, no matter what its value is.
The method overlaps with both getElementsByClassName,
getElementsByTagName and getElementById, as these filter on attribute
value as well, but it still adds extra opportunities.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg