jQuery id / class的第n项

我想使用id选择器:
$("#id")

有没有办法只对页面上带有该ID的第n个元素执行此操作?即

$("#id:n")

解决方法

页面中只能有一个具有给定ID的元素.

the HTML norm开始:

There must not be multiple elements in a document that have the same
id value.

现在假设您想要在页面获取具有给定类的第n个元素,您可以使用eq

$('.myclass').eq(index)

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...