What would cause IE to error Object doesn't support property or method 'removeChild'?
<p>I'm trying to remove 2 divs and append them at the same time. This is my script. </p>

<pre><code> parent = document.getElementById("wrap");
        if(parent){
        child =  document.getElementById("chart1b");
                  parent.removeChild(child);
           var g = document.createElement('div');
        g.id = "chart1b";
                  parent.appendChild(g);
        }
        parent2 = document.getElementById("pollwrap");
        child2 =  document.getElementById("chart2");

        parent2.removeChild(child2);

        var h = document.createElement('div');
        h.id = "chart2";

        parent2.appendChild(h)
</code></pre>

<p>In FireFox it works good. In Google Chrome it works awesome. In Safari it works Amazingly. In IE it crashes, burns, and errors start flying across my screen. Both parent divs are in the html so neither of them are missing. What could be the problem?</p>
