[jquery Filter Prevuntil ([Exp|ele][,fil])] This method is used to search for all sibling elements before the current element is found on the basis of the selector until a matching element is encountered

Source: Internet
Author: User

This method is used to search for all sibling elements before the current element is found on the basis of the selector until the matching element is encountered:

If the provided jquery represents a set of DOM elements, the. Prevuntil () method also allows us to search through the DOM tree where all the elements are located until we encounter an element that matches the supplied parameter. This new jquery object contains all of the previous sibling elements found, but does not include the element to which the selector matches

If there are no selectors to match, or if no parameters are provided, then all sibling elements that precede them are selected. This is the same as using a. Prevall () effect that does not provide parameters.

Parameters

[Expr] [, Filter]

expr: An expression for filtering ancestor elements filter: A string that contains a selection expression matching element

[element] [, Filter]

Element : Dom element for filtering ancestor elements filter: A string that contains a selection expression matching elementExample:
;} Html{font:15px/1.2em ' Courier New '; color: #666; width:750px;margin:25px auto;} div > p{white-space:pre-wrap;margin:15px 0;} Div>*{text-indent:8px;} . Hover{color: #FF96EC;}</style><script type= ' Text/javascript ' >    $(function(){       //$ (' Img.pic '). Parent (). Parent (). Prevuntil ('. List '). addclass (' hover '); Does not select an element with a class name of list$ (' Img.pic '). Parent (). Parent (). Prevuntil ('. List ', '. Selector '). addclass (' hover ')); });</script>

[jquery Filter Prevuntil ([Exp|ele][,fil])] This method is used to search for all sibling elements before the current element is found on the basis of the selector until a matching element is encountered

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.