Set the default value of an input field June 16, 2023 by Tarik This is one way of doing it: document.getElementById("nameofid").value = "My value";