Html disabled textfield to allow changes made - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Html disabled textfield to allow changes made

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
function changeVal(myval){//from w ww.  j a  v  a 2  s.co m
   document.getElementById('text1').value = myval;
}

      </script> 
   </head> 
   <body> 
      <input type="text" name="text1" id="text1" readonly> 
      <input type="button" onClick="changeVal('Change My Value')" value="Change">  
   </body>
</html>

Related Tutorials