Reputation: 17467
I am trying to travers up the tree and then down again but I do not seem to be able to combine the parent method and a regular selector.
here is what I am trying, I need to get the parent to establish the element that is being clicked and then traverse down again to the selector (#info div.tab)
$( $(this).parent() > '#info div.tab').addClass('hide-tab');
Upvotes: 0
Views: 56
Reputation: 74420
I think you want:
$(this).parent().children('#info div.tab').addClass('hide-tab');
But as IDs must be unique on context page, should be:
$('#info div.tab').addClass('hide-tab');
Upvotes: 2