Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
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
comment:2 Changed 3 years ago by miketaylr
- Priority set to low
- Status changed from new to open
- Milestone changed from 1.4.3 to 1.4.5
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 23 months ago by john
- Status changed from open to closed
- Resolution set to wontfix
You should be using .slice(1) instead of this: http://docs.jquery.com/Won%27t_Fix
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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