<input type='text' id='text' onkeyup='a()'> <div id='div'></div> <script> function a() { document.getElementById('div').innerHTML = document.getElementById('text').value } </script>