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.
你如何将以下内容翻译成 jQuery?
document.getElementsByClassName('x')[5]
$('.x')[5]似乎不起作用。我可以去
$('.x')[5]
$('.x').each(){function(i){ if(i==5) return $(this) })
但必须有一种更简单的内联方式。
您可以使用:eq()选择器:
:eq()
$('.x:eq(5)');