Easy Tutorial
❮ Html Removeclass Jquery Css ❯

jQuery :last Selector

jQuery Selectors

Example

Select the last <p> element:


Definition and Usage

The :last selector selects the last element.

Note: This selector is used to select a single element only. Use the :last-child selector to select multiple elements (one for each parent).

Common usage: Used in combination with other selectors to select the last element in a specified group (as in the example above).

Tip: To select the first element in a specified group, use the :first selector.


Syntax


Try it - Example

Difference between :last and :last-child


jQuery Selectors

❮ Html Removeclass Jquery Css ❯