jQuery hierarchical selector
Level selector
##$(s1 s2) [Father and Son]
$(s1 > s2) [parent and child]
##Direct child element selector: in s1 Internally obtain the child element node of s2
$("div > span")
$(s1 + s2) [Brother]
Direct sibling selector: Get the s2 node of the first sibling relationship immediately after s1. There cannot be any other tags between s1 and s2, otherwise Not working
$("div + span")
##$(s1 ~ s2 ) [Brothers]
Subsequent all sibling relationship node selectors: Get all s2 nodes of sibling relationships behind s1
php.cn 层次选择器
北京上海
深圳南京
杭州厦门
天津重庆合肥
Note: Please comment out the other three of the four selectors. Test one by one