Hi,
Is there a way in jQuery using selectors to identify the penultimate element?
Is there something like a :last-1?
The list can be any length so i cant use 'eq'
Any help would be much appreciated.
A.
Hi,
Is there a way in jQuery using selectors to identify the penultimate element?
Is there something like a :last-1?
The list can be any length so i cant use 'eq'
Any help would be much appreciated.
A.
Can't you just get the last element and then use .prev()
to get the penultimate element?
If you can post your HTML it would help.
Can't see your html but try this:
$("a:last").prev();
That should give you the one before the last element.
You could even try this:
$("a:last").eq(-1);