how to achieve .eq(-1) in jQuery older than 1.4?
$(selector).eq(-开发者_Go百科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?
Try this
var sLen = $(selector).length;
$(selector).eq(sLen-1);
Something like this should work:
var es = $(selector);
and then
es.get(es.length - 1)
精彩评论