tags:

views:

38

answers:

2
$(selector).eq(-1)

I spent some time to find why the above script doesn't work for me,

it's because I'm not using jQuery 1.4

How to achieve the same in older jQuery?

A: 

Try this

var sLen = $(selector).length;
$(selector).eq(sLen-1);
Nalum
A: 

Something like this should work:

var es = $(selector);

and then

es.get(es.length - 1)
Peter Jaric