The last method
The last method selects the last element among those already found.
Syntax
.last();
Example
Let's find all the paragraphs, then select the last one from those found and assign it the text '!':
<p>text</p>
<p>text</p>
<p>text</p>
$('p').last().text('!');
HTML the code will look like this:
<p>text</p>
<p>text</p>
<p>!</p>