jQuery | :gt() Selector
The jQuery :gt() Selector select all elements with an index greater than index mentioned the matched set.
Syntax:
$(":gt(Index)")
Parameter:
- index: Index number which is selected. Element which is greater than the specified index number is selected.
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>GT</title> <script src= </script> </head> <body> <table style="width:100%" border="3"> <tr> <td>0</td> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> </tr> <tr> <td>10</td> <td>11</td> <td>12</td> <td>13</td> <td>14</td> </tr> </table> <script> $("td:gt(8)").css( "backgroundColor", "lightgreen"); $("td:gt(3)").css( "color", "red"); </script> </body> </html> |
chevron_right
filter_none
Output:

Recommended Posts:
- jQuery | :last Selector
- jQuery | :first Selector
- jQuery | #id Selector
- jQuery | :has() Selector with example
- jQuery | :contains() Selector
- jQuery | :even Selector
- jQuery | :lt() Selector
- jQuery | :odd Selector
- jQuery | * Selector
- jQuery | :not() Selector
- jQuery | :first-of-type Selector
- jQuery | :last-of-type Selector
- jQuery | :nth-last-child() Selector
- jQuery | :password Selector
- jQuery | :text Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



