jQuery eq() Method (original) (raw)

Last Updated : 11 Jul, 2025

The eq() method is an inbuilt method in jQuery that is used to locate the selected elements directly and returns an element with a specific index.

Syntax:

$(selector).eq(index)

Parameters: Here the parameter "index" specifies the index of the element.
Can either be positive or a negative number.

NOTE:

jQuery code to show the working of the eq() method:

Example 1: Below code will select the specified elements.

HTML `

GeeksForGeeks articles

GeeksForGeeks

GeeksForGeeks

GeeksForGeeks

GeeksForGeeks

`

Output:

Example 2: Below code will select the specified elements with negative index.

HTML `

GeeksForGeeks articles

`

Output:

jQuery : eq() vs get():