English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The :eq() selector selects elements with a specific index number.
The index number starts from 0, so the index of the first element is 0 (not1)
This is often used with another selector to select a specific element at a certain index in a group (as shown in the following example).
$ (":eq(index)")
Select the third <tr> element:
$ (document).ready(function() { $("tr:eq(")2)").css("background", "coral"); });Test See‹/›
Parameters | Description |
---|---|
index | Specify the index of the element |