jQuery :last-childSelector
Definition and Usage
The :last-child selector selects the last child element of its parent.
Tip:Please use:first-childselector to select the first child element of its parent.
Syntax
$(":last-child")
Try it Yourself - Examples
Select the last <p> element of all <div> elements
How to select the last <p> element of all <div> elements.
The difference between :last and :last-child
Demonstrates the difference between the :last and :last-child selectors.
The difference between :last, :last-child, and :last-of-type
Demonstrates the difference between the :last, :last-child, and :last-of-type selectors.
Other Extensions
jQuery Selectors