Easy Tutorial
❮ Jquery Ref Prop Sel Previous Next ❯

jQuery :last-child Selector

jQuery Selectors

Example

Select the last <p> element that is a child of its parent:


Definition and Usage

The :last-child selector selects the last element among a group of sibling elements.

Tip: Use the :first-child selector to select the first child element of its parent.


Syntax


Try It - Examples

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

Difference between :last and :last-child

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


jQuery Selectors

❮ Jquery Ref Prop Sel Previous Next ❯