Skip to main content

Bug Tracker

Side navigation

#13606 closed bug (notabug)

Opened March 13, 2013 11:04PM UTC

Closed March 15, 2013 12:14AM UTC

Last modified March 15, 2013 12:18AM UTC

":required" property selector causes error in IE9

Reported by: contact@dmack.ca Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

In Firefox and Chrome, the selector $(':required') will correctly select any element with the HTML5 validation "required" property. In IE9, it returns this error:

SCRIPT5022: Syntax error, unrecognized expression: unsupported pseudo: required

Check it out in this fiddle: http://jsfiddle.net/G85tL/2/

Note if you change it from ":required" to "[required]", it works in all browsers.

Attachments (0)
Change History (2)

Changed March 15, 2013 12:14AM UTC by timmywil comment:1

resolution: → notabug
status: newclosed

Sizzle is correctly throwing an error. ":required" is not a valid selector.

Changed March 15, 2013 12:18AM UTC by timmywil comment:2

I see what you mean, but let me be clearer. :required works in Firefox and Chrome because it is selected with QSA and is Selectors Level 4. In IE9, Selectors Level 4 is not supported, it throws an error, it falls back to jQuery, jQuery doesn't support it, so Sizzle correctly throws an error.