.is() (since jQuery 1.0) checks whether at least one element in the current set matches a selector, callback, jQuery object, or DOM element. It returns true or false — perfect for if checks and event handlers.
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$("#box").is(".active") // true / false
$(event.target).is("li") // click was on an <li>?
$("input").parent().is("form") // official parent check
// Since 1.6:
$el.is(function () { … }) // callback test
$el.is($other) // overlap with a jQuery set?
$el.is(domNode) // same DOM element?
// Not a filter — returns boolean, not a new set
Call
What it does
jQuery set
Elements to test
selector
Since 1.0 — CSS/jQuery selector
function
Since 1.6 — return true to match
jQuery / Element
Since 1.6 — compare against nodes
Return value
Boolean only
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Select elements ($("#box"), $(event.target), …).
Step 2
Pass a selector, callback (1.6+), jQuery object, or DOM element.
Step 3
Read the boolean — true if any element matches.
Return Value
Return Value
Description
Boolean
Often true or false depending on the match or state.
jQuery object
Most setters and traversing helpers return the jQuery collection so you can chain more methods.
.is() checks whether at least one element in the current jQuery set matches a selector, passes a callback, or matches a jQuery object or DOM element. It returns true or false — not a new jQuery object. Selector form since 1.0; function, selection, and element forms since 1.6.
.filter() returns a new jQuery object with matching elements. .is() returns a boolean — true if any element matches. Use .filter() to keep matches; use .is() inside if checks.
No. It only tests the current set and returns true/false. The original collection is unchanged — ideal in event handlers and conditionals.
When at least one element in the set satisfies the argument. An empty jQuery object always returns false.
Yes, since jQuery 1.6. .is(function(index, element) { … }) runs for each element. If any call returns true, .is() returns true. Inside the callback, this is the current DOM element.
When clicks bubble from children, $(event.target).is("li") checks whether the clicked node itself is a list item — not a span or strong inside it.