Reputation: 139982
$(this).parent().next().css('display','none');
The above only hides the sibling right next to the current one.
If there are multiple ones,will fail.
Upvotes: 3
Views: 3312
Reputation: 546243
You need to use nextAll()
nextAll()
$(this).parent().nextAll().css('display','none');
or even better:
$(this).parent().nextAll().hide()
Upvotes: 9