:even (since jQuery 1.0) selects elements at zero-based even indices in the matched set — 0, 2, 4, …. That means the first, third, fifth, and so on. Partner of :odd.
Remember
$("tr:even"); // rows at indices 0, 2, 4 …
$("li:even"); // first, third, fifth items
$("td:even"); // even cells in document order
// Preferred today (jQuery 3.5+):
$("tr").even(); // same as :even
For older jQuery without .even(), use .filter(":even").
Do not confuse with CSS :nth-child(even) (1-based, parent-relative).
Piece
Required?
Role
Preceding selector
Yes
Builds the set that :even / .even filters
Indexing
—
0-based positions in that set (document order)
Matches
—
Indices where i % 2 === 0
Return value
—
jQuery set of even-indexed elements
Pseudocode
Pseudocode
set = $(precedingSelector) // indices 0 … length-1
call set.filter(":even")
// or set.even() // jQuery 3.5+
for each element at position i in set:
if i % 2 === 0:
include it
return the filtered jQuery set
Reference
Cheat Sheet
Keep these facts handy while filtering even indices.
Topic
Detail
Syntax
$("sel:even")
Since
jQuery 1.0
Deprecated
jQuery 3.4 — prefer .even() (3.5+)
Migration
:even → .even()
Indexing
0-based → first item is even
Partner
:odd / .odd()
vs :nth-child(even)
Set filter (0-based) vs CSS child (1-based)
Alt filter
$("sel").filter(":even")
Try it
Live Preview
Stripe table rows with :even, :odd, or modern .even().
Row with Index #0
Row with Index #1
Row with Index #2
Row with Index #3
Blue rows match :even (indices 0 and 2). First row is included because index 0 is even.
Result
Ready — click Run to filter rows.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Official tr:even
From the jQuery docs: match the first, third, and so on table rows.
Index 0 is even. If you wanted “2nd, 4th…” rows in everyday counting, that is closer to :odd.
CSS
Not :nth-child(even)
CSS is 1-based and parent-relative. jQuery :even filters the matched set by 0-based position.
3.4+
Deprecated since jQuery 3.4
Still works today. New code should use .even() (3.5+) or .filter(":even").
bare
Always prefix the set
Write $("tr:even") or $("tr").even() — not a bare $(":even") scan of everything.
Compatibility
Browser Support
:even has been part of jQuery since 1.0. It still works, but is deprecated since jQuery 3.4 — prefer .even() (jQuery 3.5+) for new code.
✓ Deprecated · jQuery 1.0+
jQuery :even
Works across jQuery 1.x–3.x where loaded, but avoid in new projects. Migrate to $("sel").even() on jQuery 3.5+ for better performance and future compatibility.
LegacyStatus
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
:evenDeprecated 3.4+
Bottom line: Fine for reading older tutorials. For production on jQuery 3.5+, use .even() instead of :even.
Analysis
Performance Notes
Approach
Cost
Best for
$("css").even()
Best
jQuery 3.5+ modern browsers
$("css").filter(":even")
Good
Pre-3.5 — CSS select then filter
$("el:even")
Slower
Legacy only — no querySelectorAll
Because :even is a jQuery extension, the engine cannot hand the whole query to the browser. Select with CSS, then .even() or .filter(":even").
Remember
Key Takeaways
Role: keep items at even indices (0, 2, 4…) — since jQuery 1.0.
Migrate::even → .even() (3.5+; deprecated 3.4).
Gotcha: the first element matches because index 0 is even.
One line::even picks even indices (including the first) — prefer .even() in modern jQuery.
Frequently Asked Questions
:even selects elements at zero-based even indices in the matched set — 0, 2, 4, and so on. $("tr:even") matches the first, third, and fifth rows. Available since jQuery 1.0.
Because indexing starts at 0. Index 0 is even, so the first element in the set is included. Official docs call this counter-intuitive if you expect “second, fourth…” like everyday counting.
Yes — deprecated in jQuery 3.4. Official docs recommend removing :even from selectors and filtering later with .even() (jQuery 3.5.0+): $("tr").even() replaces $("tr:even").
:even keeps indices 0, 2, 4…; :odd keeps 1, 3, 5…. Together they cover the whole matched set with no overlap.
Official docs: :even is a jQuery extension and cannot use native querySelectorAll. Select with a pure CSS selector first, then use .even() (3.5+) or .filter(":even") for better performance.
No — it filters the jQuery matched set by position in that set, in document order. It is not the same as CSS :nth-child(even), which is 1-based and parent-relative.