S
sg_maat
I have a little problem with createElement(and msie).
I was experimenting a bit with createElement and made the following
script:
<script>
var tmp = document.createElement("div");
tmp.setAttribute("name", "tmpdiv2");
tmp.setAttribute("id", "calendar");
var image = document.createElement("img");
image.setAttribute("src", "img/ok.gif");
tmp.appendChild(image);
document.getElementById("body").appendChild(tmp);
</script>
Now this script works fine in msie, netscape, mozilla, firefox and
opera.
Then i made the following script:
//create new element div
var tmp = document.createElement("div");
tmp.setAttribute("name", "tmpdiv");
tmp.setAttribute("id", "calendar");
var table = document.createElement("table");
table.setAttribute("border", "1");
var tr1 = document.createElement("tr");
var td1 = document.createElement("td");
var text = document.createTextNode("Test Text");
td1.appendChild(text);
tr1.appendChild(td1);
table.appendChild(tr1);
tmp.appendChild(table);
document.getElementById("body").appendChild(tmp);
</script>
But this script show notthing in msie(other browser work fine). And my
question really is why???
Stephan Maat
I was experimenting a bit with createElement and made the following
script:
<script>
var tmp = document.createElement("div");
tmp.setAttribute("name", "tmpdiv2");
tmp.setAttribute("id", "calendar");
var image = document.createElement("img");
image.setAttribute("src", "img/ok.gif");
tmp.appendChild(image);
document.getElementById("body").appendChild(tmp);
</script>
Now this script works fine in msie, netscape, mozilla, firefox and
opera.
Then i made the following script:
//create new element div
var tmp = document.createElement("div");
tmp.setAttribute("name", "tmpdiv");
tmp.setAttribute("id", "calendar");
var table = document.createElement("table");
table.setAttribute("border", "1");
var tr1 = document.createElement("tr");
var td1 = document.createElement("td");
var text = document.createTextNode("Test Text");
td1.appendChild(text);
tr1.appendChild(td1);
table.appendChild(tr1);
tmp.appendChild(table);
document.getElementById("body").appendChild(tmp);
</script>
But this script show notthing in msie(other browser work fine). And my
question really is why???
Stephan Maat