Skip to content

Instantly share code, notes, and snippets.

@JumboLove
Created June 7, 2013 13:38
Show Gist options
  • Save JumboLove/5729323 to your computer and use it in GitHub Desktop.
Save JumboLove/5729323 to your computer and use it in GitHub Desktop.
Trigger Click event with Enter key press
// Attach keypress handler to input box. Submit form if user presses 'enter' key.
jQuery('.email').keypress( function(e) {
if(e.which == 13) {
jQuery('#sendBtn').click();
return false;
}
return true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment