bonze .siblings()

Returns all sibling elements sharing the same parent node, excluding the source element itself. Deduplicated across multiple sources.

source element siblings

Single source element

Click a button to highlight the siblings of that item.

item-1
item-2
item-3
item-4
item-5
// click a button

Multiple sources - deduplication

Sources from two different parents. Siblings are collected and deduplicated across all sources.

#group-a
A-1
A-2
A-3
#group-b
B-1
B-2
B-3
// click a button

With callback

.siblings(callback) iterates directly over siblings without an extra call.

c-1
c-2
c-3
c-4
// click a button