Skip to the content.

$.fn.siblings([selector])

Get the siblings of every item in the collection. The element itself is always excluded from the result.

Signatures

siblings(selector?: Selector): this;

Parameters

Returns

A new Dabby collection of sibling elements (excluding the originals).

Examples

import $ from "dabbyjs";
import "dabbyjs/traversal/siblings/siblings";

// Reset siblings of the active tab
$(".tab.active").siblings().removeClass("active");
import $ from "dabbyjs";
import "dabbyjs/traversal/siblings/siblings";

// Only sibling list items that are still incomplete
$("li.complete").siblings(".incomplete");

See also