[whatwg] getElementsByAttr

On Fri, 06 Jul 2007 21:24:25 +0200, Sander <html5 at zoid.nl> wrote:

> I'd like to see a getElementsByAttr method. It would be quite similar as
> the getElementsByClassName method but with an extra argument:
>
> getElementsByAttr(attribute_name, value)

The W3C's WebAPI group is specifying a selectors API (the spec was mostly  
put together by Anne van Kesteren, and now Lachy Hunt is finishing it up),  
which allows you to do this. The longest running issue is the name of the  
methods (hopefully we have some closure on that now...) but it lets you do  
something like

methodName("*[lang|=en]") that returns whatever matches that selector....

the current editor's draft can be found at  
http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html

cheers

Chaals

-- 
   Charles McCathieNevile, Opera Software: Standards Group
   hablo espa?ol  -  je parle fran?ais  -  jeg l?rer norsk
chaals at opera.com    Catch up: Speed Dial   http://opera.com

Received on Friday, 6 July 2007 12:43:56 UTC