jQuery Tutorial Tutorials - jQuery .last() method

jQuery .last() method

The .last() method in jQuery is used to filter the set of matched elements, keeping only the last one.

jQuery .last() method Syntax

.last()

jQuery .last() method Example

example

Highlight the last item

$('li').last().css('background','cyan');

Try now

Date:2019-08-26 13:52:32 From:www.Lautturi.com author:Lautturi