Hey,
Please try this code:
Seems to work in Firefox but not in IE. I put the alert() in to show that the html is actually inserted into the div but it just doesnt show up
Can anyone help out with why?
Cheers
Andy
Please try this code:
Code:
<html>
<head>
<script language="javascript">
function initialise(){
mytable = document.createElement("table");
mytr = document.createElement("tr");
mytd = document.createElement("td");
mytd.innerHTML = "Test";
mytr.appendChild(mytd);
mytable.appendChild(mytr);
mydiv = document.getElementById("test");
mydiv.appendChild(mytable);
alert(mydiv.innerHTML);
}
</script>
<head>
<body onload="initialise();">
<div id="test"></div>
</body>
</html>
Seems to work in Firefox but not in IE. I put the alert() in to show that the html is actually inserted into the div but it just doesnt show up
Can anyone help out with why?
Cheers
Andy
Comment