Select All Next Siblings .nextAll([selector])

.nextAll([selector])

selector is optional
e.g. $("span").nextAll()

.nextAll([selector]) will select all next siblings, if selector is provided then they should match selector.

Example 1: $("span").nextAll() will find all next siblings of each <span>.
<div>A</div>
<span>B</span>
<b>C</b>
<div>D</div>
<div>E</div>
Example 2: $("span").nextAll("div") will find all next siblings of type <div> for each <span>.
<div>A</div>
<span>B</span>
<b>C</b>
<div>D</div>
<div>E</div>
jQuery traversing tree .nextAll([selector])