Input field readonly to users but editable via DOM, getElementById('23').value - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Number

Description

Input field readonly to users but editable via DOM, getElementById('23').value

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from  w w  w . j a  v  a 2  s.c o m
document.getElementById('23').value="Something else";
    }

      </script> 
   </head> 
   <body> 
      <input type="text" id="23" value="Something" readonly>  
   </body>
</html>

Related Tutorials