W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2007

[whatwg] getElementsByAttr

From: Charles McCathieNevile <chaals@opera.com>
Date: Tue, 10 Jul 2007 10:18:52 -0400
Message-ID: <op.tu851qftwxe0ny@widsith.local>
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.



   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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:57 UTC