<html>
<body>
Search: <input type="search" id="mySearch">
<p>Click the button to change the width of the search field.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("mySearch").size = "50";
}
</script>
</body>
</html>