.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.
Remember
$("#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
Build a jQuery set, then ask a yes/no question about it.
Select elements ($("#box"), $(event.target), …).
Pass a selector, callback (1.6+), jQuery object, or DOM element.
Read the boolean — true if any element matches.
Branch with if — do not expect a chainable jQuery object.
In click handlers, test event.target to ignore child nodes.
Piece
Required?
Role
jQuery set
Yes
Elements to test
selector
One form
Since 1.0 — CSS/jQuery selector
function
One form
Since 1.6 — return true to match
jQuery / Element
One form
Since 1.6 — compare against nodes
Return value
—
Boolean only
Pseudocode
Pseudocode
set = $(...)
function is(test):
for each element in set:
if element matches test: // selector / callback / node
return true
return false
// Empty set → always false
// Never returns a new jQuery object
Reference
Cheat Sheet
Keep these facts handy while testing matches.
Topic
Detail
Syntax
$el.is(selector | fn | $set | element)
Since
1.0 · function / selection / element since 1.6
Returns
true or false
Modifies set?
No
Any match?
Yes — one hit is enough
Empty set
Always false
vs .filter()
Boolean test vs keep matching elements
Event tip
$(event.target).is("li")
Try it
Live Preview
Pick a demo element and see common .is() checks — same idea as the official jQuery API examples.
Hidden demo nodes below are tested with :first-child, .blue, and :contains('Peter').
First
Blue
Peter
Plain
Result
Ready — choose an element and click Run .is().
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
One line:.is() returns a boolean match test — use .filter() when you need the matching elements.
Frequently Asked Questions
.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.