Skip to content

Instantly share code, notes, and snippets.

@marcusshepp
Created April 8, 2016 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusshepp/f160b9293efdbc68f0dda8a1c68a9762 to your computer and use it in GitHub Desktop.
Save marcusshepp/f160b9293efdbc68f0dda8a1c68a9762 to your computer and use it in GitHub Desktop.
javascript keycodes for chars and both delete btns
var keycode = event.which;
var valid_key = (keycode > 47 && keycode < 58) ||
(keycode > 64 && keycode < 91) ||
keycode == 8 || keycode == 48 ||
keycode == 190;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment