$(function () { $("#tbx1").keydown(function (event) { $("#div1").append("keydown:" + event.which + "<br/>"); }); $("#tbx1").keypress(function (event) { $("#div1").append("keypress:" + event.which + "<br />"); }); $("#tbx1").keyup(function (event) { $("#div1").append("keyup:" + event.which + "<br/>"); }); });
<input id="tbx1" type="text" /><br /> <div id="div1"></div>