Suppose you want to get specific elements through hierarchical relationships between DOM elements, such as descendant elements, child elements, neighboring elements, sibling elements, and so on, you need to use a hierarchy selector.
1,ancestor descendant
method of Use : $ ("form input"); return value collection element
Description: Matches all descendant elements under a given ancestor element. This is to be said in the following "parent> child" area separate.
2 , Parent > Child
How to use : $ ("form > Input"); return value collection element
Description: Matches all child elements under a given parent element. Note: To distinguish between descendants and child elements
3,prev + next
How to use : $ ("label + input"); return value collection element
Description: Matches all next elements immediately following the Prev element
4,prev ~ siblings
How to use : $ ("form ~ input"); return value collection element
Description: Matches all siblings elements after the Prev element. Note: The element that is after the match , not including the element, and siblings matches the elements of the prev sibling, whose descendants are not matched.
Note : ("prev ~ div") Selectors can only select the " # prev " Elements behind the sibling elements ; and JQuery the methods in siblings () independent of front and back position , just if Peer Node You can select
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
Dark Horse DAY16 jquery& hierarchy Selector