Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
jQuery

First and Last Elements in jQuery

Pick ends of a selection with first(), last(), and eq(index).

First and Last Elements in jQuery — a practical guide to jQuery first last eq with clear examples you can reuse in real projects.

jQuery Tutorial Series (51/101). Prefer one article? Read the complete jQuery tutorial.

Short description

eq() is zero-based like arrays.

first last eq

$('li').first();
$('li').last();
$('li').eq(2);

Leave a reply

Your email address will not be published. Required fields are marked *