My simple jQuery keypress script is not working.
All i want to do is capture the input on a textarea (id = story) and log the key that was pressed to the console. I want the character logged to the console to be the actual character that was pressed as opposed to the keycode. I had some confusion between keyup and keypress events, but i have tried both, and i constructed the code below based on the jQuery documentation.
<script>
$('#story').keypress(function()
{
var txtInput = this.value;
console.log(txtInput);
});
</script>
Try this