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

jQuery :eq() Selector

jQuery :eq() Selector

jQuery selector jQuery selector

Example

Select the second

element:

$("p:eq(1)")

Try it »


Definition and Usage

The :eq() selector selects the element with the specified index value.

The index value starts at 0, so the first element has an index of 0 (not 1).

Most common usage: used together with other selectors to select the element at the specified index in a specified group (as in the example above).


Syntax

$(":eq(

index

)")

Parameters Description
index Required. Specifies the index of the element.

jQuery selector jQuery selector