Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery :odd Selector

jQuery :odd Selector

jQuery selector jQuery selector

Example

Select every other (odd) element:

$("tr:odd")

Try it »


Definition and Usage

The :odd selector selects every element with an odd index number (such as 1, 3, 5, and so on).

Index values start at 0; the first element is even (0), the second is odd (1), and so on.

Most common usage: used together with other selectors to select every element with an odd position in a specified group (as in the example above).

**Tip:** Please use :even selector to select elements with even positions.


Syntax

$(":odd")


jQuery selector jQuery selector