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=
Geeks
Geeks for Geeks
jQuery
Last Child Selector
`
Output:
Example 2: Here is another example of a last-child selector.
HTML `
jQuery :last-child SelectorGeeks
Geeks for Geeks
jQuery
Geeks for Geeks
jQuery
Last Child Selector
jQuery:Last Child Selector
`
Output:
Supported Browsers:
- Google Chrome 90.0+
- Internet Explorer 9.0
- Firefox 3.6
- Safari 4.0
- Opera 10.5