Created
June 7, 2013 13:38
-
-
Save JumboLove/5729323 to your computer and use it in GitHub Desktop.
Trigger Click event with Enter key press
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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