Find descendants of every item in the collection that match the selector. The selector is evaluated against each element's subtree (not against the elements themselves), and the results are gathered into a single new collection.
find(selector: Selector): this;selector(Selector) — a CSS selector string, node, array of nodes, or Dabby collection identifying descendants to keep.
A new Dabby collection containing every matched descendant of the original collection.
import $ from "dabbyjs";
import "dabbyjs/traversal/find/find";
// All external links inside any article
$("article").find("a.external");import $ from "dabbyjs";
import "dabbyjs/traversal/find/find";
// Find a particular form field within a known wrapper
const $email = $(".signup-form").find("input[name=email]");import $ from "dabbyjs";
import "dabbyjs/traversal/find/find";
// Find can take a Dabby collection or node, not just a string
const $rows = $("table");
const $cells = $rows.find($("td.value"));- $.fn.children() — direct children only
- $.fn.filter() — filter the current collection
- $.fn.closest() — walk up to the nearest matching ancestor