Possible Duplicate:
JavaScript event.keyCode constants
This is my code:
$button.on('keyup', function (event) {
// Detect an Enter keypress
if(event.keyCode === 13) {
doStuff();
}
});
As you can see, the keycode 13
is hardcoded. Is there a (cross-browser) way to fish out that number in a more semantically meaningful way?