jQuery :lt() Selector
Example
Select the first 4 elements:
$("tr:lt(4)")
Try it »
Definition and Usage
The :lt() selector selects elements with an index value less than the specified number.
Index values start at 0.
Most common usage: used together with other selectors to select elements before a specified position in a specified group (as in the example above).
**Tip:** Please use :gt selector to select elements with an index value greater than the specified number.
Syntax
$(":lt(
index
)")
| Parameters | Description |
|---|---|
| index | Required. Specifies the element to select. |
| will select elements with an index value less than the specified number. |
jQuery selector