Home >>jQuery Tutorial >jQuery :last Selector

jQuery :last Selector

jQuery :last Selector

jQuery :last selector in jQuery is used to selects the last single element you can select more than one element (one for each parent).

Here is an Example of jQuery :last Selector:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$("p:last").css("background-color", "lightgreen");
<p>This is a first paragraph.</p>
<p>This is a second paragraph.</p>
<p>This is a Third paragraph.</p>


This is a first paragraph.

This is a second paragraph.

This is a Third paragraph.