jQuery :last-of-type Selector
Example
Select the last
element of every
element:
$("p:last-of-type")
Try it »
Definition and Usage
The :last-of-type selector selects all elements that are the last child of their specific type within their parent.
**Tip:** This selector is the same as :nth-last-of-type(1).
**Tip:** Please use :first-of-type selector to select all elements that are the first child of their specific type within their parent.
Syntax
$(":last-of-type")
Try it - Example
The last of the element
Element
How to select all
The last of the element
.
Difference between :last, :last-child, and :last-of-type
Demonstrate the difference between the :last, :last-child, and :last-of-type selectors.
jQuery selector