Detecting arrow key presses in JavaScript
Arrow keys are only triggered by onkeydown, not onkeypress. The keycodes are: left = 37 up = 38 right = 39 down = 40
Arrow keys are only triggered by onkeydown, not onkeypress. The keycodes are: left = 37 up = 38 right = 39 down = 40
The whole point of jQuery is that you don’t have to worry about browser differences. I am pretty sure you can safely go with enter being 13 in all browsers. So with that in mind, you can do this: