Jquery parent-child sibling node search sample code
This article describes how to find the parent and child node of jquery. For more information, see
JQuery. parent (expr) finds Father's Day points and can pass in expr for filtering, for example, $ ("span "). parent () or $ ("span "). parent (". class ")
JQuery. parents (expr) is similar to jQuery. parents (expr), but it is used to find all ancestor elements, not limited to parent elements.
JQuery. children (expr). Return all child nodes. This method only returns the direct child node and does not return all child nodes.
JQuery. contents (), which returns all the following content, including the node and text. The difference between this method and children () is that, including blank text
JQuery object, children () Only returns nodes
JQuery. prev (), returns the previous sibling node, not all sibling nodes
JQuery. prevAll (), returns all previous sibling nodes
JQuery. next (), returns the next sibling node, not all sibling nodes
JQuery. nextAll (), returns all the following sibling nodes
JQuery. siblings (), returns the siblings node, regardless of the front and back
JQuery. find (expr) is completely different from jQuery. filter (expr. JQuery. filter () is a part of the initial jQuery object set, while jQuery. find ()
NO content in the initial set, for example, $ ("p"), find ("span"), is from
Element search, equivalent to $ ("p span ")