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

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 UTC