内容简介:翻译自:https://stackoverflow.com/questions/2735891/how-to-remove-the-last-element-of-a-jquery-selection
我使用 jquery
选择器:
$('#menus>ul>li>a')
我想在没有最后一个的情况下迭代选择器结果:
$('#menus>ul>li>a').removeLast().each(fct());
当然函数“removeLast()”不存在,是否有等价的?
谢谢.
您可以使用:not selector或.not()方法:
$('#menus>ul>li>a:not(:last)')
要么
$('#menus>ul>li>a').not(":last")
翻译自:https://stackoverflow.com/questions/2735891/how-to-remove-the-last-element-of-a-jquery-selection
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- HashMap之元素删除
- LeetCode-数组-删除元素
- PHP删除数组中指定下标的元素方法
- php – 删除foreach循环中的数组元素
- php 删除一维数组中某一个值元素的操作方法
- jQuery删除/清空指定元素下的所有子节点的方法
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Usability for the Web
Tom Brinck、Darren Gergle、Scott D. Wood / Morgan Kaufmann / 2001-10-15 / USD 65.95
Every stage in the design of a new web site is an opportunity to meet or miss deadlines and budgetary goals. Every stage is an opportunity to boost or undercut the site's usability. Thi......一起来看看 《Usability for the Web》 这本书的介绍吧!