jQuery.find( selector [, context ] ) (alias $.find) is the selector engine jQuery uses internally (Sizzle in jQuery 1.3–3.x). It returns a plain array of DOM elements, not a jQuery object. This is the static helper on $, not the .find() traversal method.
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$.find(selector) → Array of DOM elements
$.find(selector, context) → search inside context only
$.find("li.item") // from the document
$.find("span", document.getElementById("box"))
// Advanced (Sizzle signature):
$.find(selector, context, results, seed)
Call
What it does
$.find(selector)
Search the whole document and return an array of matches.
$.find(selector, context)
Search only inside a DOM element or document.
$.find(sel, ctx, results)
Push matches onto an existing array and return that array.
$.find.matchesSelector(el, expr)
Return true when one element matches a selector.
jQuery.find is an internal, officially undocumented API and may change between major versions. In app code prefer $(selector, context) or $context.find(selector).
Parameters
Parameter
Description
selector
String — a CSS or jQuery selector, including jQuery extensions such as :first or :contains().
context (optional)
Element or Document — where to search. Defaults to document. Must be a native DOM node, not a jQuery object.
results (advanced, optional)
Array — an existing array to push the matches onto. That same array is returned.
seed (advanced, optional)
Array — a list of elements to filter by the selector instead of searching the DOM.
Return Value
Return Value
Description
Array
A plain array of matched DOM elements in document order. It is empty when nothing matches. If you pass results, that array is returned.
Not a jQuery object
No .css() or .addClass() on the result. Wrap it with $( $.find(sel) ) when you need jQuery methods.
jQuery Examples
Example 1 — Search the Whole Document
Call $.find() with only a selector and inspect the plain array it returns.
Select.$.find("li.item") runs the selector engine on the document.
Array. The result is a real array, so Array.isArray() is true.
Read. Each entry is a raw DOM element — use textContent, not .text().
Example 2 — Limit the Search with a Context
Pass a DOM element as the second argument to search only inside it.
jQuery
var box = document.getElementById("a");
var inA = $.find("span", box);
var all = $.find("span");
console.log(inA.length); // 2
console.log(all.length); // 4
Same elements. The engine behind $(selector) is $.find.
Wrapper.$(...) and .find() wrap the matches in a jQuery object.
Raw array.$.find() skips the wrapper, so it is not a jQuery instance.
Frequently Asked Questions
jQuery.find(selector, context) is the entry point to jQuery's selector engine (Sizzle in jQuery 3.x). It runs a CSS or jQuery selector and returns a plain array of matching DOM elements. $(selector) and the .find() method use it internally.
$.find() is a static utility on the jQuery function: it takes a selector and optional DOM context and returns an array. .find() is an instance method on a jQuery collection: $("#list").find(".item") searches descendants and returns a new jQuery object you can chain.
It is not documented in the official jQuery API and is treated as internal. It has worked for years, but the engine behind it can change between major versions, so avoid it in application code.
A plain JavaScript array of DOM elements in document order, or an empty array when nothing matches. If you pass a results array as the third argument, matches are pushed onto it and that same array is returned.
No. The context must be a native DOM element or document. Unwrap a jQuery object first with [0] or .get(0), or simply use $(selector, context) which accepts both.
Use $(selector) for the whole page, $(selector, context) or $context.find(selector) for a scope, and $.contains() or .is() for checks. Use document.querySelectorAll() when you do not need jQuery-only selectors like :first.