Javascript examples for DOM HTML Element:Input Text
Get the value of input in a div
<html> <head> <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]; console.log(getV.value); } </script> </head> <body> <div id="my"> <input value="E" size="2" maxlength="2" type="text"> </div> </body> </html>