Bug Tracker

Opened 9 years ago

Closed 8 years ago

#6427 closed bug (wontfix)

: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:

Change History (3)

comment:1 Changed 9 years ago by dmethvin

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

comment:2 Changed 8 years ago by miketaylr

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.

comment:3 Changed 8 years ago by john

Resolution: wontfix
Status: openclosed

You should be using .slice(1) instead of this: http://docs.jquery.com/Won%27t_Fix

Note: See TracTickets for help on using tickets.