21

What are the key codes for the right and left arrow keys?

mikemaccana
  • 94,893
  • 84
  • 350
  • 433
ajsie
  • 74,062
  • 99
  • 267
  • 376

2 Answers2

38

Left: 37, Right: 39.

Discovery of other keycodes can be done with the following code:

$('body').keyup(function (event) {
  console.log(event.keyCode);
});

Which will output the keycode to the console when you press any key.

Sampson
  • 259,174
  • 73
  • 529
  • 557
10

left key - 37

right key - 39

rahul
  • 179,909
  • 49
  • 229
  • 260