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:
Component: selector Version: 1.3.1
Keywords: Cc:
Blocked by: Blocking:

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 class="className"></div>
  <div class="className"></div>
$("div.className:not(:first)").length); // == 2 in IE
$(".className:not(:first)").length); // == 2 in IE
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

instead of

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


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


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:

You should use .slice(1) instead.