jQuery :last-child Selector
Example
Select the last
child element of its parent:
$("p:last-child")
Try it »
Definition and Usage
The :last-child selector selects the last child element of its parent.
**Tip:** Please use :first-child selector to select the first child element of its parent.
Syntax
$(":last-child")
Try it - Example
The last of the element
Element
How to select all
The last of the element
.
Difference between :last and :last-child
Demonstrate the difference between the :last and :last-child selectors.
Difference between :last, :last-child, and :last-of-type
Demonstrate the difference between the :last, :last-child, and :last-of-type selectors.
jQuery selector