Menu
Hey guys….I hope this is a simple question….
I have a bunch of hidden divs that I would like to toggle displaying by using javascript. I have it setup so if you click a URL the div is shown and if you click the same URL it is hidden.
What I would like to do is display hidden div1 when clicking on URL1, but when clicking on URL2 it would hide div1 first and then display div2.
This is the JS I’m currently using:
function DisplayDIV(d) {
if (document.getElementById(d).style.display == “block”) {
document.getElementById(d).style.display = “none”;
}else{
document.getElementById(d).style.display = “block”;
}
}
Any ideas?
Thanks!!