So, I have this sample code:
<textarea id="input" onkeydown="pressed()"></textarea>
<div id="output"></div>
<script>
function pressed()
{
var input = document.getElementById('input').value;
document.getElementById('output').innerHTML = input;
}
</script>
My problem is, if type something on the input
, the script wont write it on the output
immediately, it only does after I type another key.
So, is there anything that im not doing right?? Help pls