I'm trying to do a shortcut.
When the escape is clicked, should appear a message, but is not working.
I tried with the enter(13), and it worked:
JSFiddle:
function shortcuts(event) {
if (event.which === 27) {
alert('teste');
event.preventDefault();
return false;
}
};
<textarea name='static' id='static' onkeypress="shortcuts(event);"></textarea>