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