Back
How would you set the default value of a form <input> text field in JavaScript?
Try using the code given below:
document.getElementById("mytext").value = "My value";
31k questions
32.8k answers
501 comments
693 users