Maybe the title didn't really state what my question is.\[code\]<ul> <li>A</li> <li>B</li> <li class="test">C</li> <li>D</li></ul>\[/code\]what I am trying to do is apply background colour to the adjacent siblings of an element with class "test", and itself as well, totally three of them will have a background colour.so i have to do the following.\[code\] $('ul li.test').each(function(){ $(this).prev().css('background','red'); $(this).css('background','red'); $(this).next().css('background','red'); });\[/code\]which i reckon it is a pretty ugly coding.Is there a way to do something like $(prev, this, next).somefunction()thank you