madscientist
asked on
removeChild() not working in IE
Hi, I have some elements which I have added using createElement() from a button event handler. I also have another button so that I can remove the elements which I have added, but although it worked in Firefox and Opera, both IE 6 and 7 won't do it.
HTML:
<div id="container">
<table id="table">
<tr id="tr1">
[......]
</tr>
<tr id="tr2"><!--This and its children created using createElement()...-->
[......]
</tr>
<table>
</div>
JS:
function remove_elem() {
var elemid = document.getElementById('t r2');
elemid.parentNode.removeCh ild(elemid );
}
Many Thanks, Adam.
HTML:
<div id="container">
<table id="table">
<tr id="tr1">
[......]
</tr>
<tr id="tr2"><!--This and its children created using createElement()...-->
[......]
</tr>
<table>
</div>
JS:
function remove_elem() {
var elemid = document.getElementById('t
elemid.parentNode.removeCh
}
Many Thanks, Adam.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.