jQuery :first Selector

Example

Select the first <p> element:

$('p:first')

Try It Yourself

Definition and Usage

:first selector selects the first element.

The most common usage: used with other elements to select the first element in the specified combination (as shown in the above example).

Syntax

$(':first')