#5728 closed bug (duplicate)
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 (4)
Changed 13 years ago by
Attachment: | index.html added |
---|
comment:1 Changed 13 years ago by
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 |
comment:2 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
A test case for reproducing the bug.