[whatwg] getElementsByAttr

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

Received on Tuesday, 10 July 2007 07:18:52 UTC