I am using the following keyup event handler .
<script type="text/javascript">
$('.someClass').on('keyup', function(e){
console.log($(this).val());
});
</script>
When writing the keyup event , and typing “qwe”.
actual result : “qwe”
desired result :
“q”
“qw”
“qwe”
i simplified it here , but i also tried with closure , what is the right way?
I found a tricky (ugly?) solution that works even if you type quickly:
See here: http://jsfiddle.net/FZHZJ/1/
Note it doesn’t print on modifier keyup events (ie. backspace, shift, arrows) – if you want that also then reply and I’ll try to fix it.