homerUK
06-09-2004, 10:43 AM
I add a DIV layer to my page using the appendChild() function.. here's the code:
div = document.createElement("DIV");
div.id = "layer1";
div.style.height = "200px";
div.style.width = "140px";
div.style.background = "#CCCCCC";
div.style.display = "block";
document.appendChild(div);
how do I then remove it from the screen?! I've tried
document.getElementById("layer1").style.display = "none";
but that has no effect. I was thinking something like removeChild() ?? But cant seem to find any documentation or tutorials on this sort of thing.
any help is much appreciated.
div = document.createElement("DIV");
div.id = "layer1";
div.style.height = "200px";
div.style.width = "140px";
div.style.background = "#CCCCCC";
div.style.display = "block";
document.appendChild(div);
how do I then remove it from the screen?! I've tried
document.getElementById("layer1").style.display = "none";
but that has no effect. I was thinking something like removeChild() ?? But cant seem to find any documentation or tutorials on this sort of thing.
any help is much appreciated.