Forum Moderators: mack
</SCRIPT>
<TABLE>
<TR><TD><DIV onclick="showhide('O')">Show One</DIV></TD></TR>
<TR><TD><DIV id=O style="DISPLAY: none; VISIBILITY: hidden">ONE</DIV></TD></TR>
<TR><TD><DIV onclick="showhide('T')">Show Two</DIV></TD></TR>
<TR><TD><DIV id=T style="DISPLAY: none; VISIBILITY: hidden">TWO</DIV></TD></TR>
</TABLE>
</BODY>
</HTML>
Is there another way of doing this?Can anyone please help me out of this.I need it to be working in both browsers.
Thank you
function show(c) {
if (document.getElementById && document.getElementById(c)!= null)
node = document.getElementById(c).style.display='';
else if (document.layers && document.layers[c]!= null)
document.layers[c].display = '';
else if (document.all)
document.all[c].style.display = '';
}
function hide(c) {
if (document.getElementById && document.getElementById(c)!= null)
node = document.getElementById(c).style.display='none';
else if (document.layers && document.layers[c]!= null)
document.layers[c].display = 'none';
else if (document.all)
document.all[c].style.display = 'none';
}
This should work for both IE and Netscape.
HTH,
-gs
I have removed the VISIBILITY: hidden from both of the DIV tags though. See below:
<HTML>
<HEAD></HEAD>
<BODY>
<SCRIPT language=JavaScript>
function show(c) {
if (document.getElementById && document.getElementById(c)!= null)
node = document.getElementById(c).style.display='';
else if (document.layers && document.layers[c]!= null)
document.layers[c].display = '';
else if (document.all)
document.all[c].style.display = '';
}
function hide(c) {
if (document.getElementById && document.getElementById(c)!= null)
node = document.getElementById(c).style.display='none';
else if (document.layers && document.layers[c]!= null)
document.layers[c].display = 'none';
else if (document.all)
document.all[c].style.display = 'none';
}
</SCRIPT>
<TABLE>
<TR><TD><DIV onclick="show('O')">Show One</DIV></TD></TR>
<TR><TD><DIV id=O style="DISPLAY: none;">ONE</DIV></TD></TR>
<TR><TD><DIV onclick="show('T')">Show Two</DIV></TD></TR>
<TR><TD><DIV id=T style="DISPLAY: none;">TWO</DIV></TD></TR>
</TABLE>
</BODY>
</HTML>
-gs