<html>
<body>
Homepage: <input type="url" id="myURL" size="30">
<p>Click the button to display the value of the size attribute of the URL field.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
let x = document.getElementById("myURL").size;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>