Hide TextBox in html - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text


Hide TextBox in html

Demo Code

ResultView the demo in separate window

      <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> 
    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"

Related Tutorials