jQuery :lt() Selector (original) (raw)

Last Updated : 11 Jul, 2025

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:

Example 1: In this example, we are using it() selector.

HTML `

jQuery :lt() Selector

Welcome to My Web Page

  1. GEEKS
  2. FOR
  3. GEEKS
  1. GEEKS
  2. FOR
  3. GEEKS
  1. GEEKS
  2. FOR
  3. GEEKS
  1. GEEKS
  2. FOR
  3. GEEKS

`

Output:

Example 2: Here is another example of it() selector.

HTML `

jQuery :lt() Selector

jQuery | :lt() Selector

  1. GEEKS
  2. FOR
  3. GEEKS
  1. GEEKS
  2. FOR
  3. GEEKS
  1. GEEKS
  2. FOR
  3. GEEKS
  1. GEEKS
  2. FOR
  3. GEEKS

Change color

`

Output: