Set the default value of an input field

This is one way of doing it:

document.getElementById("nameofid").value = "My value";

Leave a Comment