W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2008

Re: [selectors-api] First element example

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Fri, 21 Nov 2008 16:41:17 +0100
Message-ID: <4926D69D.7060203@lachy.id.au>
To: Gavin Kistner <gavin@phrogz.net>
CC: public-webapps@w3.org

Gavin Kistner wrote:
> The second example in section 8 uses the following code:
>   var x = document.querySelector("#foo, #bar");
> 
> It goes on to rather explicitly state, "In the sample document above, it 
> would select the div element with the ID of foo because it is first 
> ***in document order***" (my emphasis).
> 
> Nonetheless, I believe the example code could help clarify the situation 
> further by being changed to:
>   var x = document.querySelector("#bar, #foo");

I added an explicit statement after the example to say that the order of 
the selectors used doesn't have any effect and provided an additional 
example with them reversed.

You can review the changes in the latest editor's draft.

http://dev.w3.org/2006/webapi/selectors-api/

Please let me know whether or not you are satisfied with this response.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Friday, 21 November 2008 15:42:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:28 GMT