how to get the nth sibling relative to one of the siblings
I have an unordered list element which has click events registered. What i want is to be able to find the
nth
relative
sibling to the list item that is clicked. In prototype I can simply say $(elm).next(3) or $(elm). previous(3) for the 3rd sibling forwards or backwards from the current sibling.
In JQuery there doesn't seem to be a way of getting a sibling relative to the current one, other than the immediate next() or prev(). So if I want the third previous I have to do this in JQuery
$(elm).prev().prev().prev()
which feels very clunky. Can someone advise a better way?
Thanks...dave