W3C home > Mailing lists > Public > public-webapi@w3.org > January 2007

Re: [selectors api] Why two methods?

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sun, 28 Jan 2007 00:12:56 +0100
To: "Anne van Kesteren" <annevk@opera.com>
Cc: David Håsäther <hasather@gmail.com>, public-webapi@w3.org
Message-ID: <mkmnr2dacorbil3rfmub9hl3rq57acbcfh@hive.bjoern.hoehrmann.de>

* Anne van Kesteren wrote:
>On Thu, 25 Jan 2007 15:04:52 -0500, David Håsäther <hasather@gmail.com>  
>wrote:
>> Yes, but grabbing the first node has its own method. Grabbing the second  
>> or last does not. What I don't understand is _why_ there is a special  
>> method for grabbing the first node? I just don't think that is a common  
>> thing to do, and as Jim said, those nodes usually have an id.
>
>It's not about getting the first node, as demonstrated. It's about getting  
>a single node.

The single element method returns the first node in document order that
matches the selector. That's the "first" David is talking about. You are
talking about the "first" child of an element.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Saturday, 27 January 2007 23:18:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:56 GMT