Home  >  Article  >  Web Front-end  >  Usage examples of nextUntil() method in jQuery_jquery

Usage examples of nextUntil() method in jQuery_jquery

WBOY
WBOYOriginal
2016-05-16 16:21:431334browse

The example in this article describes the usage of nextUntil() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:

This function finds all sibling elements after the specified element until it encounters the matching element, but does not include the matching element.

Grammar structure 1:

Copy code The code is as follows:
$(selector).closest(expr, filter)

Parameter list:

参数 描述
expr 用于筛选匹配元素的表达式。
filter 可选。用于筛选nextUntil()函数通过expr表达式取得的jquery元素集合。

Example code:

Example 1:

Copy code The code is as follows:






Script Home






  • HTML Zone

  • Javascript Zone

  • Div Css Zone

  • Jquery Zone

  • ASP Zone

  • JSP Zone





Example 2:

Copy code The code is as follows:






Script Home






  • HTML Zone

  • Javascript Zone

  • Div Css Zone

  • Jquery Zone

  • ASP Zone

  • JSP Zone





Grammar structure 2:

Copy code The code is as follows:

$(selector).closest(element, filter)

Parameter list:

参数 描述
element 用于筛选匹配元素的DOM对象。
filter 可选。用于筛选nextUntil()函数通过DOM对象取得的jquery元素集合。

Example code:

Example 1:

Copy code The code is as follows:






Script Home






  • HTML Zone

  • Javascript Zone

  • Div Css Zone

  • Jquery area

  • ASP Zone

  • JSP Zone





Example 2:

Copy code The code is as follows:






Script Home






  • HTML Zone

  • Javascript Zone

  • Div Css Zone

  • Jquery area

  • ASP Zone

  • JSP Zone





I hope this article will be helpful to everyone’s jQuery programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn