If you only need to exclude out enter
, escape
and spacebar
keys, you can do the following:
$("#text1").keyup(function(event) {
if (event.keyCode != '13' && event.keyCode != '27' && event.keyCode != '32') {
alert('test');
}
});
You can refer to the complete list of keycode here for your further modification.