How would you set the default value of a form <input> text field in JavaScript?

18 s
18

This is one way of doing it:

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

Leave a Reply

Your email address will not be published. Required fields are marked *