Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一个页面中有许多具有相同类名的 div。如何使用 jquery 仅选择具有特定类名的第二个 div,但没有别的选择?谢谢!!
您可以使用.eq如下功能,
.eq
$(selector).eq(1) //should return you the second element of the matching selector.
或者您可以使用:eq()如下选择器,
:eq()
$('selector:eq(1)') //should return you the second element of the matching selector.