返回值:jQueryeq(index)
概述
获取第N个元素
这个元素的位置是从0算起。
参数
indexInteger
元素在jQuery对象中的索引
示例
描述:
获取匹配的第二个元素
HTML 代码:
<p> This is just a test.</p> <p> So is this</p>jQuery 代码:
$("p").eq(1)结果:
[ <p> So is this</p> ]获取第N个元素
这个元素的位置是从0算起。
元素在jQuery对象中的索引
获取匹配的第二个元素
<p> This is just a test.</p> <p> So is this</p>$("p").eq(1)[ <p> So is this</p> ]