#12443 closed bug (invalid)
prop() Bug in IE9
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | attributes | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
html code :
<div hidden="true"> </div>
when using $.prop("hidden") in IE 9,it returns "undefined",but other brower such as firefox\IE 7\IE 8\Chrome returns "true" as expected. <a href="http://jsfiddle.net/Ap2L4/">code in jsFiddle</a>
Change History (5)
comment:1 Changed 10 years ago by
Component: | unfiled → attributes |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 follow-ups: 3 4 Changed 10 years ago by
The current result seems like a beneficial feature to me anyway, it's pretty clear from it that IE9 does not support the HTML5 hidden
attribute. I can't see why we'd want to shim the property and mask the browser's lack of support for it.
http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#the-hidden-attribute
comment:3 Changed 10 years ago by
Thanks for your request,but the problem is that I change the attribute "hidden" to any other name , for example "notShow","ab" and so on,it doesn't work in ie 9 any more.At contrast, if i use getAttribute("hidden") of dom,i can get the value of "hidden",see code below. Code :alert($("#test").get(0).getAttribute("hidden"));
comment:4 Changed 10 years ago by
Replying to dmethvin:
The current result seems like a beneficial feature to me anyway, it's pretty clear from it that IE9 does not support the HTML5
hidden
attribute. I can't see why we'd want to shim the property and mask the browser's lack of support for it.http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#the-hidden-attribute
I set the attrbuite "hidden"(other name else) to div is that i want get the configuration data from html elements for some jquery plug in like jqgrid.
comment:5 Changed 10 years ago by
HTML doesn't map all attributes to properties by default, only a small number of them. If you want the attribute, use .attr()
and not .prop()
. http://jsfiddle.net/Ap2L4/1/
prop is a low-level method that returns whatever the property value is in the browser. Although results may be different in different browsers, manipulation of these values would be disastrous.