Matches all elements with an index below the given one : Selector even odd index « jQuery « JavaScript DHTML
- JavaScript DHTML
- jQuery
- Selector even odd index
Matches all elements with an index below the given one
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("td:lt(1)").css("color", "red");
});
</script>
</head>
<body>
<table border="1">
<tr><td>Row</td></tr>
<tr><td>Row</td></tr>
<tr><td>Row</td></tr>
<tr><td>Row</td></tr>
</table>
</body>
</html>
Related examples in the same category