Romer http://www.cnblogs.com/laomo/
<body><div id="Main"> <div id=" Hot" class="Rightbar"> class="P"> melted olive oil </li> <li> diaper diapers </li> <li id="h"> Organic rice </li> <li> Smart Trash bags </li> <li> Youku milk Tea </li> <liclass="m"> Kissing Jelly </li> </ul> </li> <li> <ul> <li> Sea-Flying silk shampoo </li> <li> six divine toilet waters </li> <li> Soothing Fragrance Soap </li> <li> Heart photo paper towel </li> <li> wow haha mineral water </li> <li> Wanglaoji </li> </ul> </li> </ul> </DIV></DIV&G T;</body>
<script type= "Text/javascript" language= "JavaScript" >//here for jquery code </script>
Test 1: Test Next, let the next brother of Id= "H" li Element (organic rice) highlight
$ ("#h"). Next (). CSS ("Background-color", "Red");
Effect:
Test 2: Test Nextall, let id= "H" of the Li Element (organic rice) of all the younger brothers highlight
$ ("#h"). Nextall (). CSS ("Background-color", "Red");
Effect:
Test 3: Test Nextuntil, let the id= "H" of the Li Element (organic rice) of all the younger brother highlight, until the class name is the element of M terminated
$ ("#h"). Nextuntil (". M"). CSS ("Background-color", "Red");
Effect:
Prev and Next are the same, but one is a brother, one is a brother, the same prevall and Nextall,prevuntil and Nextuntil are basically the same, no longer repeat the test
Test 4: Test siblings, let the id= "H" of the Li Element (organic rice) of all the brothers are highlighted (including brother and brother)
$ ("#h"). Siblings (). CSS ("Background-color", "Red");
Effect:
Test 5: Test siblings, let id= "H" of the Li Element (organic rice) of all brothers in accordance with the class name is the highlight of M
$ ("#h"). Siblings (". M"). CSS ("Background-color", "Red");
Effect:
jquery Find Brothers Series next (), Nextall (), Nextuntil (), prev (), Prevall (), Prevuntil (), siblings ()