<title>jQuery :last selector to Select Last List Items</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
$(document).ready(function(){
$('.mylibtn').click(function(){
$( "ul.mylist li:last" ).css( "color", "orange" );
<h2>jQuery :last selector to Select Last List Items</h2>
<p><button type="button" class="mylibtn">Click Me to Color Last List Item</button></p>
<li>Select last list item.</li>
<li>Apply color to the last list item.</li>
<li>Learn jQuery from website Tutorialdeep.</li>
<li>Create your own website with our web development guide.</li>
<li>Use live examples to learn everything.</li>