Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: How to hide button


Message #1 by "S.ArunSrinivasan" <arun@o...> on Sun, 12 May 2002 14:25:17 +0530 (IST)
Hello, I think I know the problem: 
It's because the button wasn't in a <form>. 
But I couldn't test if it works yet. 

<head>
<script language="JavaScript">

NN = (document.layers) ? true : false;
IE = (document.all)    ? true : false;

function hideMe() {

  if (NN) {

    document.layers.button1.visibility = "hidden";

  }

  if (IE) {

    document.all.button1.style.visibility = "hidden";

  }

}

</script>
</head>
<body>
<form>
<input type="Button" value="Click Me" id="button1" onClick="hideMe()">
</form>
</body>

  Return to Index