Easy Tutorial
❮ Misc Globaleval Sel Eq ❯

jQuery :last-of-type Selector

jQuery Selectors

Example

Selects each <p> element that is the last <p> element of its parent:


Definition and Usage

The :last-of-type selector selects all elements that are the last child of their type within their parent.

Tip: This selector is equivalent to :nth-last-of-type(1).

Tip: Use the :first-of-type selector to select all elements that are the first child of their type within their parent.


Syntax


Try it - Examples

Select the last <p> element within each <div>

Differences between :last, :last-child, and :last-of-type


jQuery Selectors

❮ Misc Globaleval Sel Eq ❯