<html> <head> </head> <body> <input id="my_msg" type="text"> </body> <script> document.getElementById('my_msg').value = "text-value"; </script> </html>