W3C home > Mailing lists > Public > public-webapi@w3.org > March 2008

Re: [Element Traversal LC] access to element by index

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 28 Mar 2008 12:37:28 -0500
Message-ID: <47ED2CD8.4030907@mit.edu>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
CC: "Web APIs WG (public)" <public-webapi@w3.org>

Daniel Glazman wrote:
>    myFooElement.querySelector("*:nth-child(3)") does NOT work since
>    there can be another 3rd child in traversal order before the
>    3rd child of myFooElement.

Being devil's advocate for a sec, having a :scope pseudo-class or some 
such would help here, right?

   myFooElement.querySelector(":scope > :nth-child(3)")

I do agree this is not nearly as clean as indexing....

-Boris
Received on Friday, 28 March 2008 17:38:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 28 March 2008 17:38:12 GMT