Get the value of input in a div - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text


Get the value of input in a div

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*w  w w.  jav a2s . c om*/
var getV = document.getElementById("my").getElementsByTagName('input')[0];

      <div id="my"> 
         <input value="E" size="2" maxlength="2" type="text"> 

Related Tutorials