聘我网

新概念招聘3.0

jQuery中如何选取某个元素的第N个子元素?

vote up0vote downstar
<div id="target">
...
</div>

比如要查DIV#target的第2个子元素? 新手问题,多多指教!

 

1 个答复

vote up0vote downcheck

使用nth-child

$('#target>:nth-child(2)')
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.