?
Solved

removeChild() not working in IE

Posted on 2006-10-31
2
Medium Priority
?
537 Views
Last Modified: 2012-06-27
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('tr2');
  elemid.parentNode.removeChild(elemid);
}

Many Thanks, Adam.
0
Comment
Question by:madscientist
1 Comment
 
LVL 41

Accepted Solution

by:
HonorGod earned 200 total points
ID: 17841595
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question