Forum Moderators: open
I am using the following code to hide & show objects in IE5, but it's not working in Netscape?
<script language="JavaScript1.2">
function ShowMe( )
{
document.all.t3.style.display="";
}
</script>
<html>
<body>
<FORM name="x">
<input type="button" value="show" onClick="ShowMe( );">
<TABLE id="t3" style="display:none">
<TR><TD>
<FONT size="-1">Welcome to IE & NetSc problems ;-)</FONT>
</TD></TR>
</TABLE>
</FORM>
</body>
</html>
Any help will be welcome.
Thanks
<script language="javascript">
function show(id)
{
if (ns4)
document.layers[id].visibility = "show"
else if (ie4)
document.all[id].style.visibility = "visible"
}
function hide(id)
{
if (ns4)
document.layers[id].visibility = "hide"
else if (ie4)
document.all[id].style.visibility = "hidden"
}
function go( )
{
ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
alert( "Nescape : "+ns4 );
alert( "IE : "+ie4 );
hide( 'd1' );
}
function Show_NOW( )
{
show( 'd1' );
}
function Hide_NOW( )
{
hide( 'd1' );
}
</script>
<html>
<body onLoad="go( );">
<div id="d1">
<table>
<tr>
<td>
BLOCK A
</td></tr>
<tr>
<td>
<div id="d2">
<table>
<tr>
<td>
BLOCK B
</td></tr>
</table>
</div>
</td></tr>
</table>
</div>
<form>
<input type="button" name="x" value="SHOW" onClick="Show_NOW( );">
<input type="button" name="z" value="HIDE" onClick="Hide_NOW( );">
</form>
</body>
</html>