jquery-Another result set (descendant, ancestor, or sibling element) based on an existing result set

Source: Internet
Author: User

1. Get descendant elements
1) Children ()
Do not pass parameters: get the child elements of all the elements in the result set
Incoming selector: Gets the child elements of the incoming selector that match the elements in the result set
2) Find ()
Incoming selector: Gets the descendant elements of the matching selector
Incoming jquery, HtmlElement, htmlelement[]
Gets the intersection of the descendant elements of all elements in the result set and the corresponding elements of the parameter objects
2. Get ancestor elements
1) offsetParent ()
Returns the first element in an ancestor whose position is set to relative or absolute.
This method is valid only for visible elements
2) Parent ()
Gets the parent element of the element in the result set
can be filtered with an optional selector
3) Parents ()
Gets the ancestor elements of the elements in the result set, which can be filtered by an optional selector.
4) Parentsuntil ()
Finds all ancestor elements of the current element until (but not including) the element to which the match is encountered is stopped
First incoming parameter: HTML element object, jquery object, selector
Second incoming parameter (optional): selector (Filter the results)
3. Quick access to Brother elements
1) Next ()
Gets a collection of elements that contain the next sibling element adjacent to each element in the matching element collection
Can pass in selectors for filtering
2) Nextall ()
Finds all sibling elements after the current element
Can pass in selectors for filtering
3) Nextuntil ()
Finds all of the sibling elements after the current element until (but not including) the element that encounters the match stops.
First incoming parameter: Domelement,jquery object, Selector
Second incoming parameter (optional): selector (Filter the results)
4) prev ()
Gets a collection of elements that contain the first sibling element immediately adjacent to each element in the matching element collection
Can pass in selectors for filtering
5) Prevall ()
Finds all sibling elements before the current element
Can pass in selectors for filtering
6) Prevuntil ()
Finds all of the sibling elements before the current element until (but not including) the element that meets the match stops
First incoming parameter: Domelement,jquery object, Selector
Second incoming parameter (optional): selector (Filter the results)
7) siblings ()
Gets a collection of elements that contain all the sibling elements of each element in the matching element collection
Can pass in selectors for filtering

jquery-Another result set (descendant, ancestor, or sibling element) based on an existing result set

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.