From jQuery JavaScript Library
« Back to Selectors
:gt(index)
Matches all elements with an index above the given one.
Arguments:| index | Number | |
|---|
| Zero-based index. |
Examples:| Name | Type |
Finds TD #5 and higher. Reminder: the indexing starts at 0.
$("td:gt(4)").css("text-decoration", "line-through");
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="../jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("td:gt(4)").css("text-decoration", "line-through");
});
</script>
</head>
<body>
<table border="1">
<tr><td>TD #0</td><td>TD #1</td><td>TD #2</td></tr>
<tr><td>TD #3</td><td>TD #4</td><td>TD #5</td></tr>
<tr><td>TD #6</td><td>TD #7</td><td>TD #8</td></tr>
</table>
</body>
</html>