Example

Select the last p element:

$("p:last")

Try it yourself »

Definition and Usage

The :last selector selects the last element.

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

Syntax

$(":last")