开发者

Calling children of specified index?

Anyone know the proper syntax to write this statement?

$('.nav ul li')[0].children("a")

For some reason this is not working. The return i开发者_如何学Pythons that its not a function. :(


You can try this for getting the first element from the results.

$('.nav ul li').first().children("a")

Or if you need a specific index

$('.nav ul li').eq(0).children("a")

You can also use the selectors :eq(n) and :first if you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜