Hi, I am trying to create previous and next links in a slideshow. I need some help finding the ID of the previous sibling in a specific class.
Example: when a link with the class of 'slideshow-choice' is clicked, I need to get the ID of the previous link with the same class. I am pretty sure I can find the previous item with this: $("#"+myid).prev("a.slideshow-choice");. But, I can't figure out how to get the ID of that item. This is what I have so far... $(document).ready( function() { $("a.slideshow-choice").click(function() { var myid = this.id; // get the id of the link just clicked. var x = $("#"+myid).prev("a.slideshow-choice"); //guessing this is how i locate previous item }); }); What am I missing that will provide me with the ID of the closest sibling? Thanks in advance. - Jim _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/