Closed Bug 685 Opened 27 years ago Closed 24 years ago

document.documentElement.removeChild() doesn't work for IMGs

Categories

(Core :: Layout, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: angus, Assigned: vidur)

Details

Here's the test case I'm using: <html> <head> <script> function init() { var foo = document.getElementsByTagName("IMG")[0]; alert(foo); // tells me I've got an HTMLImageElement document.documentElement.removeChild(foo); } </script> </head> <body onload="init();"> <img src="http://my.netscape.com/mys/images/nnc_lockup.gif"> </body> </html>
The documentElement is the <HTML> element, not the <BODY> element. I haven't got document.body hooked up yet, but when I do, you should be able to do document.body.removeChild(foo). In the meantime, do: body = document.documentElement.childNodes[1]; body.removeChild(foo);
Component: Unknown → Layout
mid-air collision ? / bugzilla cleanup Reopening (current State: resolved and no resolution)
Status: RESOLVED → REOPENED
not clear but marking invalid
Status: REOPENED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
The test case still doesn't do anything... But it doesn't look like valid DOM to me (removeChild is shallow?) so I'm verifying invalid.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.