jQuery :lt() Selector Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The jQuery :lt() selector selects elements using an index number that works on less than a specified number. The index numbers start from 0. Syntax: $(":lt(index)")Parameter: index: Index number which is selected. The element which is lesser than the specified index number is selected.Example 1: In this example, we are using it() selector. HTML <!DOCTYPE html> <html> <head> <title>jQuery :lt() Selector</title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> $(document).ready(function () { $("ol:lt(3)").css( "background-color", "green"); }); </script> </head> <body> <h1>Welcome to My Web Page</h1> <ol id="1"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <ol id="2"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <ol id="3"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <ol id="4"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> </body> </html> Output: Example 2: Here is another example of it() selector. HTML <!DOCTYPE html> <html> <head> <title>jQuery :lt() Selector</title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> $(document).ready(function () { $("button").click(function () { $("ol:lt(2)").css("color", "red"); }); }); </script> </head> <body> <h1>jQuery | :lt() Selector</h1> <ol id="1"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <ol id="2"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <ol id="3"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <ol id="4"> <li>GEEKS</li> <li>FOR</li> <li>GEEKS</li> </ol> <br> <button>Change color</button> </body> </html> Output: Comment V Vijay Sirra Follow Improve V Vijay Sirra Follow Improve Article Tags : Web Technologies JQuery jQuery-Selectors Explore jQuery Tutorial 8 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read Like