<html>
<body>
<input type="search" id="mySearch">
<p>Click the button to disable the search field.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("mySearch").disabled = true;
}
</script>
</body>
</html>