Next: An element adjacent to $ (')
Nextall: All sibling elements after $ (')
Nextuntil:until have until ... Before the meaning, so he represents $ (") all subsequent sibling elements, but to the Nextuntil parameter, does not include the matching element itself
All sibling elements before and after sibings:$ (')
A simple understanding is that next is to find his brother/sister, Nextall is to find all his younger brother/sister, Nextuntil is to find a younger brother/sister than his younger, siblings is to find all his brother/sister, and all his brother/sister. So the same peer relationship, Prev,prevall, Prevuntil
The following is a simple test code
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8" >
<title>Document</title>
<script type= ' text/javascript ' src= ' http://code.jquery.com/jquery-1.9.1.min.js ' ></script>
<body>
<div class= "a" >
<a href= "#" >hhh</a>
<p> this is a test</p>
<p> this is a test</p>
<p> this is a test</p>
<p> this is a test</p>
<div>hhha</div>
<p> this is a test</p>
<p> this is a test</p>
</div>
<script>
$ (function () {
$ (' P:first '). Next (). CSS (' background ', ' red ');
$ (' P:first '). Nextall (). CSS (' background ', ' yellow ');
$ (' P:first '). Nextuntil (' div '). css ({' font-size ': 20,background: ' Red '});
$ (' P:first '). Siblings (). CSS (' background ', ' yellow ');
});
</script>
</body>