Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Web Technology by (20.3k points)

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

1 Answer

0 votes
by (40.7k points)

Try using the code given below:

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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...