On 1/27/07, Anne van Kesteren <[EMAIL PROTECTED]> wrote:

On Thu, 25 Jan 2007 15:04:52 -0500, David Håsäther <[EMAIL PROTECTED]>
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.

I don't see any difference:.
document.getElementBySelector("html > p")
is the same as document.getElementListBySelector("html > p")[0]

document.getElementBySelector("html > p:not(:first-child)")
is the same as document.getElementListBySelector("html >
p:not(:first-child)")[0]

document.getElementBySelector("html > p:last-child")
is the same as document.getElementListBySelector("html > p:last-child")[0]

as far as I can see.

Regards,
Martijn

Reply via email to