As the title says, I'm having an issue with IE8 (works in FF and IE9). The following code doesn't produce any errors, and if I substitute div,ul,and li; it works. I did some searching and didn't find anything on (table,tr,td) tags not being supported using document.createElement
with IE8. Where am I going wrong?
Here is the code:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>My Page Title</title>
<script>
function init() {
var ele = document.getElementById('content');
var table = document.createElement('table');
var tr = document.createElement('tr');
var td = document.createElement('td');
var txt = document.createTextNode('IE8');
td.appendChild(txt);
tr.appendChild(td);
table.appendChild(tr);
ele.appendChild(table);
}
</script>
</head>
<body onload="init();">
<div id="content"></div>
</body>
</html>