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.


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

Lachlan Hunt - Opera Software
Received on Friday, 21 November 2008 15:42:00 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:12 UTC