Next: an element next to $ ('')
NextAll: all peer elements after $ ('')
NextUntil: until available... So it represents all peer elements after $ (''), but it does not include the matching element before the nextUntil parameter.
Sibings: all peer elements before and after $ ('')
Simply put, next is to find his younger brother/sister, nextAll is to find all his younger brother/sister, nextUntil is to find younger brother/sister than him, siblings is to find all his brothers/sisters and all his younger siblings. So the same peer relationship, prev, prevAll, prevUntil
The following is a simple test code.
Copy codeThe Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml" xml: lang = "en">
<Head>
<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>
</Head>
<Body>
<Div class = "first">
<A href = "#"> hhh </a>
<H1> This is a title <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'hangzhou.next().css ('background', 'red ');
// $ ('P: first'hangzhou.nextall().css ('background', 'yellow ');
// $ ('P: first'0000.nextuntil('div'0000.css ({'font-size': 20, background: 'red '});
// $ ('P: first'hangzhou.siblings().css ('background', 'yellow ');
});
</Script>
</Body>
</Html>