.nextAll()
methodThe .nextAll()
method in jQuery is used to get all following siblings element of the matched elements.
.nextAll()
method Syntax.nextAll() .nextAll(selector)
.nextAll()
method ExampleFind all the items after Item3 and highlight them
HTML
<ul> <li>item1</li> <li>item2</li> <li class="third">item3</li> <li>item4</li> <li class="five">item5</li> </ul>
jQuery
$(".third").nextAll(); $(".third").nextAll('li'); $(".third").nextAll('.five');
Result
[<li>item4</li>,<li>item5</li>] [<li>item4</li>,<li>item5</li>] [<li>item5</li>]