Opened 11 years ago
Closed 11 years ago
#11398 closed bug (invalid)
Using .prop() on "required" in IE
Reported by: | MrMamen | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | attributes | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'm trying to find the attribute "required" on a input field, but this failes in IE9 when using the .prop() function. While you could argue that IE doesn't support "required" and therefore the property should be false, this is not consistent, as IE8 and Safari doesn't support required either, but the prop returns true if the attribute is present. Even compability mode shows different behaviour.
Also isn't the point of jQuery's .prop() to avoid using .attr("required") === "required", and that it should work the same way in all browsers?
Change History (1)
comment:1 Changed 11 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Firstly, Safari does support required (but will not stop form submissions if invalid input is entered). Secondly, IE6-8 does not set the required property to the boolean
true
, but the string"required"
. Anything other than the booleantrue
means that required is not supported.http://jsfiddle.net/timmywil/yhLDK/3/
We certainly cannot change the property values and we should not hide their values with the
.prop()
method.