jQuery selector of the acquisition ancestor class, grade brothers, sons-level elements

First, access to an ancestral element
1, parent (selector): Returns the parent element directly, optionally filtered.
2, parents (selector): Returns the ancestor element, comprising a parent element, optionally filtered.
3, closest (selector): returns the first ancestor element (ancestors parent, grandparent, great grandfather, and so on.), Beginning from the current element in the DOM tree upwards, optionally filtered.

Second, obtaining sibling level elements
1, next (selector): Returns the next element fellow selectively filtered.
2, nextAll (selector): Returns all fellow behind the elements, optionally filtered.
3, prev (selector): a fellow return element (opposite to the next), optionally filtered.
4, prevAll (selector): Returns all preceding fellow elements (nextAll and vice versa), select filtered.
5, siblings (selector): fellow returns all the elements, regardless of before and after, optionally filtered.

Third, access descendant level elements
1, children (selector): Returns the direct child elements, optionally filtered.
2, find (selector): Returns the descendants of the current element, select filtered.
3, contents (): returns the direct child elements, including text and comment nodes selected element. The method and children () method similar, except that it returns the text and comment nodes. If in the same domain, contents () method can also access the iframe HTML.

Other:
1, filter (Selector): Returns the element meet certain conditions.

Guess you like

Origin blog.csdn.net/qq_38882327/article/details/90312805