Skip to main content

Bug Tracker

Side navigation

#4028 closed bug (wontfix)

Opened January 29, 2009 08:45PM UTC

Closed July 11, 2011 06:18PM UTC

".className:not(:first)." incorrect in IE

Reported by: bryfox Owned by: john
Priority: major Milestone: 1.next
Component: selector Version: 1.3.1
Keywords: Cc:
Blocked by: Blocking:
Description

1. The selector '$(".className:not(:first)").length)' returns one too many elements in IE.

2. The selector '$("div.className:not(:first)").length)' returns one too many elements in IE if the className divs are inside a containing div.

Tested in IE6 and IE7 under windows XP, jQuery 1.3.1. (No problem with 1.2.6.)

Example markup:

<div>
  <div class="className"></div>
  <div class="className"></div>
</div>
<script>
$("div.className:not(:first)").length); // == 2 in IE
$(".className:not(:first)").length); // == 2 in IE
</script>
Attachments (1)
Change History (8)

Changed January 30, 2009 12:57AM UTC by dmethvin comment:1

Confirmed; it behaves the same way in IE8RC1, with a name other than className, and using

.ready()
instead of
document.write
.

Changed October 16, 2009 01:35PM UTC by arangas comment:2

Confirmed in IE8 RTM (8.0.6001.18702).

Changed November 19, 2010 02:35AM UTC by dmethvin comment:3

Changed February 26, 2011 06:38PM UTC by anonymous comment:4

+1 had this issue too.

Changed March 11, 2011 07:34PM UTC by laubstein comment:5

This problem is still present: jQuery 1.5.1

Testcase: http://jsfiddle.net/laubstein/rU4h4/

Changed March 30, 2011 09:20PM UTC by danheberden comment:6

milestone: 1.3.21.next

Changed July 11, 2011 06:10PM UTC by john comment:7

#4468 is a duplicate of this ticket.

Changed July 11, 2011 06:18PM UTC by john comment:8

resolution: → wontfix
status: openclosed

This isn't something that we're going to fix:

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

You should use .slice(1) instead.