Hide label whenever something is typed in text box - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Hide label whenever something is typed in text box

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <span id="one">text</span> 
      <input type="text" onkeypress="hide()"> 
      <script>
var isHidden = false;//ww w  . j  av  a  2 s .co  m
function hide(){
  if(!isHidden){
   isHidden = true; document.getElementById("one").setAttribute("style","display:none");
  }
}

      </script>  
   </body>
</html>

Related Tutorials