Hide TextBox in html - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Hide TextBox in html

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  ww  w . j  av a  2s.c o m
      document.getElementById("myP").style.visibility = "hidden"
    }
    function show() {
      document.getElementById("myP").style.visibility = "visible"
    }
  
      </script>  
   </body>
</html>

Related Tutorials