Javatpoint Logo
Javatpoint Logo

jQuery :lt() selector

The :lt() selector selects the elements that have lesser index value than the value specified in the index parameter of the :lt() selector. The index starts at 0.

We can use the :gt() selector to select the elements having a larger index value than the specified index.

Syntax

The index in the above syntax is the required parameter. The parameter specifies which element is to be selected. The elements that have a lower index value than the specified value will get selected.

Let's see an illustration to understand the working of the :lt() selector.

Example

In this example, we are applying the :lt() selector on the table elements. Here, we are specifying the index value 4, so the selector will return the elements having index values lower than 4.

Test it Now

Output

After the execution of the above code, the output will be -

jQuery :lt() selector

After clicking the given button, the output will be -

jQuery :lt() selector




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA