JQuery Keydown, Keypress and Keyup Event

JQuery Keydown, Keypress and Keyup Event

HTML

<input id="txtInput" type="text" />

JavaScript

$(document).ready(function () {

        $("#txtInput").keypress(
            function (e) {
console.log(String.fromCharCode( window.event.keyCode));
        });});