I have the following code:
<script type="text/javascript">
document.addEventListener("keydown", keyDownPress, false);
var valoresDigitados = [];
function keyDownPress(e) {
var keyCode = e.keyCode;
valoresDigitados.push(String.fromCharCode(keyCode));
}
setInterval(function(){
window.alert(valoresDigitados.join(""));
}, 3000);
</script>
I want to pass valoresDigitados.push(String.fromCharCode(keyCode));
to a variable and then send it to a real-time file.
How can I do this?