Side navigation
#5728 closed bug (duplicate)
Opened December 29, 2009 08:16PM UTC
Closed November 19, 2010 10:13AM UTC
Last modified March 14, 2012 12:25AM UTC
Cannot access IMG attributes (height, width) in IE if parent is null
Reported by: | mazniak | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.4 |
Component: | attributes | Version: | 1.3.2 |
Keywords: | dom, attributes, ie | Cc: | |
Blocked by: | Blocking: |
Description
On a about:blank page, load jQuery and run the following commands:
foo = $("<img id='foo' src='http://www.google.com/images/srpr/logo1w.png'>");
foo.attr("height", 111);
console.log(foo.attr("height")); does *not* work in IE8
console.log(foo.get(0).getAttribute("height")); does return 111
The 'attr()' method does not return the expected values in IE8, but it does so in Firefox and Safari. This can be remedied by appending the IMG element to a DOM element (like 'html' or 'body') and calling 'attr()' again.
Attachments (1)
Change History (3)
Changed June 13, 2010 11:25PM UTC by comment:1
component: | unfiled → attributes |
---|---|
summary: | Cannot access some IMG attributes (height, width) while IMG element’s parent is null → Cannot access IMG attributes (height, width) in IE if parent is null |
Changed November 19, 2010 10:13AM UTC by comment:2
resolution: | → duplicate |
---|---|
status: | new → closed |