Skip to main content

Bug Tracker

Side navigation

#7063 closed bug (invalid)

Opened September 22, 2010 03:26PM UTC

Closed September 22, 2010 08:41PM UTC

Bug with :not and :last

Reported by: hobbestigrou Owned by:
Priority: Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: selector, :last, :not, :first Cc:
Blocked by: Blocking:
Description

Hi,

I'm using the latest version of jQuery 1.4.2.

I have a problem with :not and :last I think. For exemple when I try with this syntax:

$('.reverse:visible:last:not(:first)');

and this match anything, but if I use this syntax:

$('.reverse:visible:not(:first):last');

This matches one element, so this is ok.

I've tried with chromium 6.0.4 and Firefox 3 and 4.

Attachments (0)
Change History (1)

Changed September 22, 2010 08:41PM UTC by snover comment:1

resolution: → invalid
status: newclosed

This is not a bug.

The first selector finds the last .reverse, then removes it if it is the first of the filtered elements. Since it is always the first, it will always be filtered away.

The second selector finds all .reverse that are not the first, and then picks the last one of those.