Forum Moderators: open
Youwill need to add some stuff to this if you are going to support Netscape 4 but I am sure with a little searching you can do that.
Give each div an id.
<div id=divone></div>
<div id=divtwo></div>
in javascript do something like this;
// style function
function style(id){
if(document.layers) {
path = document.layers[id];
} else if(document.all) {
path = document.all[id].style;
} else {
path = document.getElementById(id).style;
}
return path;
}
style('divone').visibility = "hidden";
style('divtwo').visibility = "visible";
For the css elements that have two words like "background_color:" you put the words in camel case like this
style('divtwo').backgroundColor = "red";
There it is a simple div styler.