Select Next Sibling .next([selector])

.next([selector])

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

.next([selector]) will select next adjacent sibling, if selector is provided then it should match selector.

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