Why doesn't this code add the string Username to the input field?
It runs in the snippet below but not locally on a basic test.html page.
<script type="text/javascript">
document.getElementById("username").value = "Username";
</script>
<input id="username" name="username" value="">
Code snippet:
document.getElementById("username").value = "Username";
<input id="username" name="username" value="">