I have a website where there is a empty box and a input text box. I want to be able to type something in that input box and have it be printed on the empty box.
You use the onkeyup event
Searching with ids is a lot easier. Add ids to your elements as follows:
JS
var inputBox = document.getElementById('chatinput'); inputBox.onkeyup = function(){ document.getElementById('printchatbox').innerHTML = inputBox.value; }
Here is a Live example