jQuery does not have :prev
or :next
selectors, I have no idea where you came across them. There is a :last
selector, though, as well as :first
, provided by the Sizzle selector library, used by jQuery. It is a non-standard selector, not part of CSS, and is thus implemented in JavaScript.
One purpose of the :last
selector over the .last()
method is so you can use it to filter elements in the middle of a selector sequence, like this (note that :last
and :last-child
are not the same):
$('.a > .b:last > .c')
Rather than having to write a chain of methods like this:
$('.a').children('.b').last().children('.c');
By the way, the "colon selectors" you refer to are called pseudo-classes (colloquially but incorrectly known as "pseudo-selectors").
:prev
or:next
selector.:last
but not:prev
and:next
. Are you using some plugin?