jQuery :last Selector

Example

Select the last <p> element:

$('p:last')

Try It Yourself

Definition and Usage

:last selector selects the last element.

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

Syntax

$(':last')