<title>jQuery nextAll() Method to Get All Immediate Sibling</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
$(document).ready(function(){
$("#btn-nextall").click(function(){
$("#para-nextall").nextAll().addClass("mynewclass");
<h2>jQuery nextAll() Method to Get All Immediate Sibling</h2>
<button id="btn-nextall">Click to Set All Immediate Sibling Class</button>
<p id="para-nextall">Welcome to Tutorialdeep.</p>
<p>Learn jQuery With Working Examples.</p>
<p>Learn with output given in the same page.</p>