Internet Explorer, if I am understanding correctly, will properly run the code:

var div = document.createElement("p");
div.appendChild(document.createTextNode("Testing"));
document.getElementsByTagName("body")[0].appendChild(div);
    

But will die on this code:

var para = document.createElement("div");
para.appendChild(document.createTextNode("Also Testing"));
document.getElementsByTagName("body")[0].appendChild(para);
    

Try it:

Dammit all; it is doing it in my program, but not here... Why?


Ahh, it only happens when the page is loading and it only happens if all the content in the page is enclosed in <div>s. Now the variable name doesn't seem to matter... Damned IE...