Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13606 closed bug (notabug)

":required" property selector causes error in IE9

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:


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.

Change History (2)

comment:1 Changed 10 years ago by timmywil

Resolution: notabug
Status: newclosed

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

comment:2 Changed 10 years ago by timmywil

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.

Note: See TracTickets for help on using tickets.