如何获得第n个jQuery元素 [英] How to get nth jQuery element
本文介绍了如何获得第n个jQuery元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在jQuery中,$("...").get(3)
返回第三个DOM元素.返回第三个jQuery元素的功能是什么?
In jQuery, $("...").get(3)
returns the 3rd DOM element. What is the function to return the 3rd jQuery element?
推荐答案
为什么不首先浏览(短)选择器页面?
Why not browse the (short) selectors page first?
这里是: :eq()
运算符.它的用法与get()
相同,但它返回jQuery对象.
Here it is: the :eq()
operator. It is used just like get()
, but it returns the jQuery object.
或者您也可以使用.eq()
功能.
Or you can use .eq()
function too.
这篇关于如何获得第n个jQuery元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文