jQuery :lastchild Selector (original) (raw)

jQuery :last-child Selector

Last Updated : 11 Jul, 2025

It is a jQuery Selector used to select every element that is the last child of its parent.

Syntax:

$(":last-child")

Example 1: Here is the basic example of a last-child selector.

HTML `

jQuery :last-child Selector
<script src=

"" title="undefined" rel="noopener noreferrer">https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">

Geeks

Geeks for Geeks

jQuery

Last Child Selector

`

Output:

Example 2: Here is another example of a last-child selector.

HTML `

jQuery :last-child Selector

Geeks

Geeks for Geeks

jQuery


Geeks for Geeks

jQuery

Last Child Selector

jQuery:Last Child Selector

`

Output:

Supported Browsers: