I think that this is what you want... You make it so hard

(

)
function hidediv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideShow').style.visibility = 'hidden';
} else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'hidden';
} else { // IE 4
document.all.hideShow.style.visibility = 'hidden';
}
}
}
function showdiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideShow').style.visibility = 'visible';
} else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'visible';
} else { // IE 4
document.all.hideShow.style.visibility = 'visible';
}
}
}
- function hidediv() {
- if (document.getElementById) { // DOM3 = IE5, NS6
- document.getElementById('hideShow').style.visibility = 'hidden';
- } else {
- if (document.layers) { // Netscape 4
- document.hideShow.visibility = 'hidden';
- } else { // IE 4
- document.all.hideShow.style.visibility = 'hidden';
- }
- }
- }
-
- function showdiv() {
- if (document.getElementById) { // DOM3 = IE5, NS6
- document.getElementById('hideShow').style.visibility = 'visible';
- } else {
- if (document.layers) { // Netscape 4
- document.hideShow.visibility = 'visible';
- } else { // IE 4
- document.all.hideShow.style.visibility = 'visible';
- }
- }
- }
Example of usage...
<a href="javascript:hidediv()">Hide</a> <a href="javascript:showdiv()">Show</a>
<div class="whatever" id="hideShow">
Blahblah blah
</div>
- <a href="javascript:hidediv()">Hide</a> <a href="javascript:showdiv()">Show</a>
- <div class="whatever" id="hideShow">
- Blahblah blah
- </div>
-
I'm pretty sure you can have only one of the divs on the page... otherwise, the link would hide/show all of those divs...
If you want to have multiple of those things, you can try something like...
function hidediv(div) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(div).style.visibility = 'hidden';
} else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'hidden';
} else { // IE 4
document.all.hideShow.style.visibility = 'hidden';
}
}
}
function showdiv(div) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(div).style.visibility = 'visible';
} else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'visible';
} else { // IE 4
document.all.hideShow.style.visibility = 'visible';
}
}
}
- function hidediv(div) {
- if (document.getElementById) { // DOM3 = IE5, NS6
- document.getElementById(div).style.visibility = 'hidden';
- } else {
- if (document.layers) { // Netscape 4
- document.hideShow.visibility = 'hidden';
- } else { // IE 4
- document.all.hideShow.style.visibility = 'hidden';
- }
- }
- }
-
- function showdiv(div) {
- if (document.getElementById) { // DOM3 = IE5, NS6
- document.getElementById(div).style.visibility = 'visible';
- } else {
- if (document.layers) { // Netscape 4
- document.hideShow.visibility = 'visible';
- } else { // IE 4
- document.all.hideShow.style.visibility = 'visible';
- }
- }
- }
And usage would be something like...
<a href="javascript:hidediv(menu)">Hide</a> <a href="javascript:showdiv(menu)">Show</a>
<div class="whatever" id="menu">
Blahblah blah
</div>
<a href="javascript:hidediv(content)">Hide</a> <a href="javascript:showdiv(content)">Show</a>
<div class="whatever" id="content">
Blahblah blah
</div>
- <a href="javascript:hidediv(menu)">Hide</a> <a href="javascript:showdiv(menu)">Show</a>
- <div class="whatever" id="menu">
- Blahblah blah
- </div>
- <a href="javascript:hidediv(content)">Hide</a> <a href="javascript:showdiv(content)">Show</a>
- <div class="whatever" id="content">
- Blahblah blah
- </div>
-
I think that's how it would be... someone correct me if I'm wrong... and if this isn't what you want... I give up trying to find out.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8