<!DOCTYPE html>
<html>
<body>

Search: <input type="search" id="mySearch" value="Food">

<p>Click the button to change the default value of the search field.</p>

<button type="button" onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    document.getElementById("mySearch").defaultValue = "Drinks";
}
</script>

</body>
</html>