.odd() (since jQuery 3.5) reduces the matched set to elements at odd zero-based indexes — 1, 3, 5, …. It takes no arguments. Returns a new jQuery object; does not change the DOM.
Select a set, call .odd(), then style or process the result.
Confirm you are on jQuery 3.5+.
Select the collection (e.g. $("ul li")).
Call .odd() — no arguments.
Remember: index 0 is even → the first item is not in .odd().
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).odd()
result = empty set
for each element in set with index i (starting at 0):
if i % 2 === 1: // odd index
add element to result
return result as a new jQuery object
// 5 items → keeps indexes 1 and 3 (2nd & 4th)
Reference
Cheat Sheet
Keep odd/even methods side by side.
Topic
Detail
Syntax
.odd()
Since
jQuery 3.5
Keeps
Indexes 1, 3, 5, …
vs .even()
Even indexes 0, 2, 4, …
vs :odd
Same idea; method needs 3.5+
vs CSS :nth-child(odd)
CSS is 1-based; .odd() is 0-based
DOM change?
No — query only
Try it
Live Preview
From five list items, compare .odd(), .even(), and :odd.
list item 1
list item 2
list item 3
list item 4
list item 5
.odd() → items 2 and 4 (indexes 1 and 3). .even() → items 1, 3, and 5.
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").odd()
Mark the 2nd and 4th list items (jQuery API demo).
One line:.odd() keeps indexes 1, 3, 5… — the 2nd, 4th, 6th elements in your set.
Frequently Asked Questions
.odd() reduces the current jQuery collection to elements at odd zero-based indexes — 1, 3, 5, and so on. In a five-item list, that means the 2nd and 4th elements (indices 1 and 3).
Yes. Counting starts from zero, as the jQuery API docs emphasize. Index 1 is the second element, index 3 is the fourth. This is position in the jQuery object, not CSS :nth-child numbering.
.odd() keeps indexes 1, 3, 5… .even() keeps indexes 0, 2, 4… Together they split a collection into two alternating groups with no overlap.
Both use zero-based odd indexes on the matched set. .odd() is a method added in jQuery 3.5. $("li:odd") is the older selector form. Prefer .odd() on a current jQuery 3.5+ build for clearer chaining.
.odd() was added in jQuery 3.5. Older versions do not have this method — use $("li:odd") or .filter(":odd") instead.
No. It only returns a new jQuery object with the odd-indexed elements. Chain .css() or .addClass() if you want visual changes.