[whatwg] getElementsByAttr

Charles McCathieNevile chaals at opera.com
Tue Jul 10 07:18:52 PDT 2007


On Fri, 06 Jul 2007 23:38:37 +0200, Sander <html5 at zoid.nl> wrote:

> Dan Dorman schreef:
>> On 7/6/07, Sander <html5 at zoid.nl> wrote:
>>> I haven't read the whole draft yet so maybe it's in there, but can you,
>>> or anyone else, explain why there is both a selectElement and a
>>> selectAllElements method?
...
>> If you know you're after one element, you get to deal with it directly
>> rather than first referencing the only contents of a single-element
>> array.
> But document.selectAllElements("#first")[0] would do the trick.

The working group recognises that this is not necessarily critical either  
way, but decided on having the single element method as an optimisation  
that does something reasonably useful (in our opinion) for both the  
implementors of user agents and the authors of code.

It is listed as issue 110 in the WebAPI group issue tracker.

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



More information about the whatwg mailing list