<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<input type="text" name="username"/>
<span id="tousername"></span>
<script>
var usernameinput = document.getElementsByName("username")[0];
var touernameinput = document.getElementById("tousername");
window.onkeydown=function(){
touernameinput.innerText = usernameinput.value;
}
</script>
</body>
</html>