<!DOCTYPE html>
<html>
<body>

First Name: <input type="text" id="myText" value="Mickey">

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

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

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

</body>
</html>