<html>
<body>
Name: <input type="text" id="myText" size="30">
<p>Click the button to display the value of the size attribute in the text field.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myText").size;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_text_size by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:47:27 GMT -->
</html>