Update CSS style visibility - Javascript CSS Style Property

Javascript examples for CSS Style Property:visibility

Description

Update CSS style visibility

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <textarea id="myP">This is a textarea.</textarea> 
      <button type="button" onclick="hide()">Hide content of textarea</button> 
      <button type="button" onclick="show()">Show content of textarea</button> 
      <script>
    function hide() {//from  w  w  w .  j av a2 s .c o m
      document.getElementById("myP").style.visibility = "hidden"
    }
    function show() {
      document.getElementById("myP").style.visibility = "visible"
    }
  
      </script>  
   </body>
</html>

Related Tutorials