Reputation: 39108
I'm executing the following code as suggested here.
$("#textBox").on("keyup", function (event) {
foo(event.keyCode === 8 || event.keyCode === 64);
});
function foo(special) {
console.log(special);
}
For BackSpace it works like a charm producing true. However, Del produces false. What's up with that?!
Upvotes: 1
Views: 2921
Reputation: 15958
It's because the keycode for delete is 46 not 64.
See: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
Upvotes: 6