Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
jQuery

Siblings in jQuery

Select sibling elements with siblings(), nextAll(), prevAll().

Siblings in jQuery — a practical guide to jQuery siblings with clear examples you can reuse in real projects.

jQuery Tutorial Series (49/101). Prefer one article? Read the complete jQuery tutorial.

Short description

Useful for tab/accordion exclusive active states.

siblings

$(this).siblings().removeClass('active');
$(this).addClass('active');

Leave a reply

Your email address will not be published. Required fields are marked *