jQuery nextAll method
home
Run
screen_rotation
fullscreen
cloud_download
navigate_next
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#selectNext" ).on( "click", function(event) { $(".curr-li").nextAll().css("border","1px solid red"); }); }); </script> </head> <body> <h4><a href="javascript:void(0);" id="selectNext">Click to select next </a></h4> <ul> <li>First Item (Index 0)</li> <li >Second Item (Index 1)</li> <li class="curr-li" style="border:1px solid blue;">Third Item (Index 2) Find All From Here</li> <li>Fourth Item (Index 3)</li> <li>Fifth Item (Index 4)</li> <li>Sixth Item (Index 5)</li> <li>Seventh Item (Index 6)</li> </ul> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#selectNext" ).on( "click", function(event) { $(".curr-li").nextAll().css("border","1px solid red"); }); }); </script> </head> <body> <h4><a href="javascript:void(0);" id="selectNext">Click to select next </a></h4> <ul> <li>First Item (Index 0)</li> <li >Second Item (Index 1)</li> <li class="curr-li" style="border:1px solid blue;">Third Item (Index 2) Find All From Here</li> <li>Fourth Item (Index 3)</li> <li>Fifth Item (Index 4)</li> <li>Sixth Item (Index 5)</li> <li>Seventh Item (Index 6)</li> </ul> </body> </html>
Copyrights@tutorialsplane.com