Example

Select the first p element:

$("p:first")

Try it yourself »

Definition and Usage

The :first selector selects the first element.

This is mostly used together with another selector to select the first element in a group (like in the example above).

Syntax

$(":first")