jquery gets all the parent and sibling elements and child elements of the method
1. Gets the parent element $ ("#id"). Parent ()
Gets its parent element
$ ("#id"). Parents ()
Get all of its ancestor elements
$ ("#id"). Closest ()
Gets its nearest ancestor element, followed by
2. Gets the sibling element $ ("#id"). Next (selector)
Gets the next sibling element adjacent to the matching element. If a selector is provided, the next sibling element that matches the selector is retrieved.
$ ("#id"). Nextall (selector)
It is optional to get all the sibling elements that follow the match element, which is filtered by the selector.
$ ("#id"). Prev (selector)
Get the previous sibling element adjacent to the matching element (opposite to next)
$ ("#id"). Prevall (selector)
Gets all the sibling elements preceding the current matching element (as opposed to Nextall)
3. Gets the child element $ ("#id"). Children (selector)
Returns the child elements of the matching element, with optional parameters that can be filtered by the selector.
$ ("#id"). Find (selector)
Gets the descendants of the current element
jquery gets all the parent and sibling elements and child elements of the method