Skip to main content

Bug Tracker

Side navigation

#12443 closed bug (invalid)

Opened September 03, 2012 01:06AM UTC

Closed September 04, 2012 03:03PM UTC

Last modified September 09, 2012 01:43PM UTC

prop() Bug in IE9

Reported by: ganhuan@legendsec.com 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>

Attachments (0)
Change History (5)

Changed September 04, 2012 03:03PM UTC by timmywil comment:1

component: unfiledattributes
resolution: → invalid
status: newclosed

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.

Changed September 04, 2012 07:30PM UTC by dmethvin comment:2

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

Changed September 09, 2012 02:46AM UTC by ganhuan@legendsec.ocm comment:3

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"));

Changed September 09, 2012 02:48AM UTC by ganhuan@legendsec.com comment:4

Replying to [comment:2 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.

Changed September 09, 2012 01:43PM UTC by dmethvin comment:5

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/