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

jQuery :even Selector

jQuery :even Selector

jQuery selector jQuery selector

Example

Select every other (even) element:

$("tr:even")

Try it »


Definition and Usage

The :even selector selects every element with an even index number (such as 0, 2, 4, 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 even position in a specified group (as in the example above).

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


Syntax

$(":even")


jQuery selector jQuery selector