JQuery Keydown, Keypress and Keyup Event
JQuery Keydown, Keypress and Keyup Event
HTML
<input id="txtInput" type="text" />
JavaScript
$(document).ready(function () {
$("#txtInput").blur(function (event) {
event.preventDefault();
console.log('blur');
});
$("#txtInput").keypress(function (event) {
console.log('down 1');
$(this).blur();
console.log('down 2');
});
});