English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery :gt() Selector

jQuery Selectors

:gt() selector selects all elements with an index number greater than the specified number.

The index number starts from 0, so the index number of the first element is 0 (not1)

This is usually used with another selector to select the last element in the group (as shown in the following example).

Use:ltThe selector selects the element index number less than the specified number.

Syntax:

$(":gt(index)")

Example

Select elements with an index greater than5of all <tr> elements:

$("document").ready(function(){
  $("tr:gt(5)\
});
Test See‹/›

Select all <div> elements with an index greater than1of <p> elements:

$("document").ready(function(){
  1)\
});
Test See‹/›

Parameter Value

ParametersDescription
indexSpecify the selected index is greater than the specified number

jQuery Selectors