Skip to content

Instantly share code, notes, and snippets.

@maxparm
Created March 13, 2012 16:41
Show Gist options
  • Save maxparm/2029829 to your computer and use it in GitHub Desktop.
Save maxparm/2029829 to your computer and use it in GitHub Desktop.
JS - Jquery detect keypress enter
$('#element').on('keypress', function(e) {
if(e.which == 13) {
// action();
e.preventDefault();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment