I have a little problem with createElement(a nd msie).
I was experimenting a bit with createElement and made the following
script:
<script>
var tmp = document.create Element("div");
tmp.setAttribut e("name", "tmpdiv2");
tmp.setAttribut e("id", "calendar") ;
var image = document.create Element("img");
image.setAttrib ute("src", "img/ok.gif");
tmp.appendChild (image);
document.getEle mentById("body" ).appendChild(t mp);
</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.create Element("div");
tmp.setAttribut e("name", "tmpdiv");
tmp.setAttribut e("id", "calendar") ;
var table = document.create Element("table" );
table.setAttrib ute("border", "1");
var tr1 = document.create Element("tr");
var td1 = document.create Element("td");
var text = document.create TextNode("Test Text");
td1.appendChild (text);
tr1.appendChild (td1);
table.appendChi ld(tr1);
tmp.appendChild (table);
document.getEle mentById("body" ).appendChild(t mp);
</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.create Element("div");
tmp.setAttribut e("name", "tmpdiv2");
tmp.setAttribut e("id", "calendar") ;
var image = document.create Element("img");
image.setAttrib ute("src", "img/ok.gif");
tmp.appendChild (image);
document.getEle mentById("body" ).appendChild(t mp);
</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.create Element("div");
tmp.setAttribut e("name", "tmpdiv");
tmp.setAttribut e("id", "calendar") ;
var table = document.create Element("table" );
table.setAttrib ute("border", "1");
var tr1 = document.create Element("tr");
var td1 = document.create Element("td");
var text = document.create TextNode("Test Text");
td1.appendChild (text);
tr1.appendChild (td1);
table.appendChi ld(tr1);
tmp.appendChild (table);
document.getEle mentById("body" ).appendChild(t mp);
</script>
But this script show notthing in msie(other browser work fine). And my
question really is why???
Stephan Maat
Comment