Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Created January 4, 2014 18:32
Show Gist options
  • Select an option

  • Save joyrexus/8258750 to your computer and use it in GitHub Desktop.

Select an option

Save joyrexus/8258750 to your computer and use it in GitHub Desktop.
Show keyCode on keypress
<!DOCTYPE html>
<meta charset="utf-8" />
<body>
<script>
function getKeyCode(event) { alert(event.which) }
document.addEventListener("keypress", getKeyCode);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment