next():用來獲取下一個同輩元素。 $(".test").next();
prev():用來獲取上一個同輩元素。 $(".test").prev();
siblings():用來獲取所有的同輩元素。 $(".test").siblings();
1
2
3
$("#test1").next(); //這個獲取的等同於$("#test2")
$("#test2").prev(); //這個獲取的等同於$("#test1")
$("#test3").siblings(); //這個獲取的等同於$("#test1,#test2")