与jQuery相反:eq() [英] Opposite of jQuery's :eq()

查看:725
本文介绍了与jQuery相反:eq()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道是否存在某种选择器来从匹配的集合中选择元素,但是由指示的索引给出的元素。例如:

Does anyone know if there exist some kind of selector to select al the elements from a matched set but the one given by the indicated index. E.g.:

$("li").neq(2).size();

假设有5个元素,最后一个语句会给你4个,并且包含所有< li> 元素,但DOM中的第二个元素。

Supposing that there were 5 elements, the last statement would give you 4, and would contain all the <li> elements but the second one in the DOM.

推荐答案

使用 而非

$('li').not(':eq(2)');

这篇关于与jQuery相反:eq()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆