how to find last child element jquery code example
Example 1: jquery last child
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
</ul>
<script>
//in all the group you can find the last item with .last() function
$( "li" ).last().css( "background-color", "red" );
</script>
Example 2: check if element is last child jquery
$j("#elementToCheck").is(":last-child")