Javascript examples for DOM HTML Element:Input Text
Input Text size Property - Get the width of a text field:
<!DOCTYPE html> <html> <body> Name: <input type="text" id="myText"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/* ww w . j a v a2 s . co m*/ var v = document.getElementById("myText").size; console.log(v); } </script> </body> </html>