.even() (since jQuery 3.5) reduces the matched set to elements at even zero-based indexes — 0, 2, 4, …. It takes no arguments. Returns a new jQuery object; does not change the DOM.
Select a set, call .even(), then style or process the result.
Confirm you are on jQuery 3.5+.
Select the collection (e.g. $("ul li")).
Call .even() — no arguments.
Remember: index 0 is even → the first item is included.
Chain .append(), .addClass(), or .css() on the result.
Piece
Required?
Role
Matched set
Yes
Collection to reduce
Arguments
None
Method takes no parameters
Index base
—
Zero-based position in the set
Return value
—
New jQuery set (0 or more)
Pseudocode
Pseudocode
call $(set).even()
result = empty set
for each element in set with index i (starting at 0):
if i % 2 === 0: // even index
add element to result
return result as a new jQuery object
// 5 items → keeps indexes 0, 2, 4 (1st, 3rd & 5th)
Reference
Cheat Sheet
Keep even/odd methods side by side.
Topic
Detail
Syntax
.even()
Since
jQuery 3.5
Keeps
Indexes 0, 2, 4, …
vs .odd()
Odd indexes 1, 3, 5, …
vs :even
Same idea; method needs 3.5+
vs CSS :nth-child(even)
CSS is 1-based; .even() is 0-based
DOM change?
No — query only
Try it
Live Preview
From five list items, compare .even(), .odd(), and :even.
list item 1
list item 2
list item 3
list item 4
list item 5
.even() → items 1, 3, and 5 (indexes 0, 2, 4). .odd() → items 2 and 4.
Result
Ready — choose a call and click Run.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Official: $("li").even()
Mark the 1st, 3rd, and 5th list items (jQuery API demo).
One line:.even() keeps indexes 0, 2, 4… — the 1st, 3rd, and 5th items in everyday counting.
Frequently Asked Questions
.even() reduces the current jQuery collection to elements at even zero-based indexes — 0, 2, 4, and so on. In a five-item list, that means the 1st, 3rd, and 5th elements (indices 0, 2, 4).
Yes. Official docs emphasize counting from zero. Index 0 is the first element, index 2 is the third. This is position in the jQuery object, not CSS :nth-child numbering.
.even() keeps indexes 0, 2, 4… .odd() keeps indexes 1, 3, 5… Together they split a collection into two alternating groups with no overlap.
Both use zero-based even indexes on the matched set. .even() is a method added in jQuery 3.5. $("li:even") is the older selector form. Prefer .even() on jQuery 3.5+ for clearer chaining.
.even() was added in jQuery 3.5. Older versions do not have this method — use $("li:even") or .filter(":even") instead.
No. It only returns a new jQuery object with the even-indexed elements. Chain .css() or .addClass() if you want visual changes.