How to pass information to a javascript variable

0

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?

    
asked by anonymous 19.12.2016 / 21:05

0 answers