jQuery选择器:选择两个元素,以及之间的所有元素

我有一个UL的负载,每个都有一个唯一的ID。

给定两个ID,选择两个相应的LI以及所有LI之间的最佳方式是什么?

谢谢!

解决方法

http://api.jquery.com/nextUntil/

Given a selector expression that represents a set of DOM elements,the .nextUntil() method searches through the successors of these elements in the DOM tree,stopping when it reaches an element matched by the method’s argument. The new jQuery object that is returned contains all following siblings up to but not including the one matched by the .nextUntil() argument.

If the selector is not matched or is not supplied,all following siblings will be selected; in these cases it selects the same elements as the .nextAll() method does when no filter selector is provided.

As of jQuery 1.6,A DOM node or jQuery object,instead of a selector,may be passed to the .nextUntil() method.

The method optionally accepts a selector expression for its second argument. If this argument is supplied,the elements will be filtered by testing whether they match it…

相关文章

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