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