jQuery/naxtAll()

解説
指定した要素の次すべてを取得
sample1
  • list1
  • list2
  • list3
  • list4
sample1code
$(function(){
  $("#sample1btn").click(function(){
    $("li:eq(1)").nextAll().css("color","red");
  });
});
sample2

elementp1

elementdiv1

elementp2

elementdiv2

elementp3

elementdiv3
sample2code
$(function(){
  $("p:eq(0)").nextAll("div").css("color","red");
});