Skip to content

ElementWrapper.odd()

Definition

ts
odd(): ElementWrapper

Description

Returns a new ElementWrapper containing the elements at odd positions using 1-based indexing — that is, the 1st, 3rd, 5th elements, and so on.

Example

html
<li class="item">First</li>
<li class="item">Second</li>
<li class="item">Third</li>
<li class="item">Fourth</li>
ts
$('.item').odd(); // Wraps "First" and "Third"