When a user types in an input box, I want their name to be displayed after the text 'hello'. Instead of doing this, the word 'hello' is removed and replaced by their name.
var name = document.getElementById('username');
var div = document.getElementById('displayname');
name.onkeyup = function() {
div.value = name.value;
}
<input type="text" placeholder="Name" id="username">
<input type="submit" id="displayname" value="Hello">
JsFiddle: https://jsfiddle.net/t01prhx4/