Home >>jQuery Tutorial >jQuery :lt() Selector

jQuery :lt() Selector

jQuery :lt() Selector

jQuery :lt() selector in jQuery is used to selects elements with an index number less than a specified number which starts at 0.


Parameter Values

Parameter Description
index It is a Required parameter which is used to specifies which element to select.
Here is an Example of jQuery :lt() Selector:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$("tr:lt(4)").css("background-color", "orange");
<h1>Welcome to Phptpoint !</h1>
<table border="1">


Welcome to Phptpoint !

S.No Country
1 India
2 Italy
3 France
4 UK
5 Mexico
6 Sweden
7 Germany
8 Canada