Skip to main content

Bug Tracker

Side navigation

#6427 closed bug (wontfix)

Opened April 12, 2010 04:04PM UTC

Closed July 12, 2011 04:02PM UTC

:not(:last) with only one element returns different results

Reported by: sant0sk1 Owned by:
Priority: low Milestone: 1.next
Component: selector Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

Given an html snippet like this:

<div id="main">

<div class="item"><p>some words</p></div>

</div>

Running the following code:

$('#main').find('.item:not(:last)').length

Returns 1 in IE8, and 0 in Safari and Firefox:

Attachments (0)
Change History (3)

Changed April 13, 2010 01:01AM UTC by dmethvin comment:1

Yep, does look like a bug. IE seems to be selecting div.item for some reason.

Changed October 26, 2010 02:26AM UTC by miketaylr comment:2

milestone: 1.4.31.4.5
priority: → low
status: newopen

Live test case here: http://jsfiddle.net/pKHuY/ and confirmed that Opera and Chrome align with Safari and Firefox, reporting 0. IE8 and IE9 preview report 1.

Changed July 12, 2011 04:02PM UTC by john comment:3

resolution: → wontfix
status: openclosed

You should be using .slice(1) instead of this:

http://docs.jquery.com/Won%27t_Fix