Set CSS style visibility value - Javascript CSS Style Property

Javascript examples for CSS Style Property:visibility

Description

Set CSS style visibility value

Demo Code

ResultView the demo in separate window

<html lang="en">
   <head></head>
   <body translate="no"> 
      <div id="theMessage">
         Here goes your form
      </div> 
      <button onclick="showMsg();">show</button> 
      <button onclick="hideMsg();">hide</button> 
      <script>
      var element = document.getElementById("theMessage");
function showMsg(){/*from w  w  w . j a  v  a2 s.  c  om*/
    element.style.visibility = "visible";
}
function hideMsg() {
      element.style.visibility = "hidden";
}
    
      </script>  
   </body>
</html>

Related Tutorials