Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery :lt() Selector

jQuery :lt() Selector

jQuery selector jQuery 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 jQuery selector