.find() gets the descendants of each element in the current set, filtered by a selector, jQuery object, or DOM element. It searches the whole subtree — not just one level. Selector form since jQuery 1.0; element/jQuery argument since 1.6.
Syntax
Call .find() on a jQuery set. Start with these lines.
.find("span"). Matches the direct span and the nested one.
.children("span"). Only the span that is a direct child of #box.
Depth is the difference. Official docs: .children() travels one level only.
Frequently Asked Questions
.find() searches through all descendants of each element in the current jQuery set and returns a new jQuery object of matching nodes. Available since 1.0 (selector); element/jQuery argument since 1.6.
.children() travels only one level down (direct children). .find() searches every depth — grandchildren and deeper. Official docs: they are similar except for how far down they go.
.find() drills into descendants and can return nodes that were not in the original set. .filter() only narrows the current set — it never adds deeper nodes.
Yes. Unlike many traversing methods, .find() requires an argument. Pass "*" to get every descendant element at any depth.
No. Only descendants are candidates. $("li.item-ii").find("li") does not include item II itself — only nested li elements inside it.
Yes for the common case. Official docs: $("li.item-ii").find("li") is equivalent to $("li", "li.item-ii").