user154759
user154759

Reputation:

jQuery Dynamic selector

How can I get the adjacent sibling of a dynamic selector?

This is what I have but it is not working.

var titles = $('a.highlight');
        titles.click(function(){
                $(this + " + object.hidden").show("slow");
                return false;
            }
        );

Upvotes: 0

Views: 479

Answers (1)

brianng
brianng

Reputation: 5820

var titles = $('a.highlight');
titles.click(function(){
    $(this).siblings('.hidden').show("slow");
    return false;
});

Upvotes: 1

Related Questions