Created
July 22, 2012 23:30
-
-
Save RyannosaurusRex/3161385 to your computer and use it in GitHub Desktop.
Demonstrates JavaScript to click a send button on Enter keypress. Typical use case is a chat application where you want to auto-send when you hit Enter.
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
$("#textboxId").keyup(function (event) { | |
if (event.keyCode == 13) { | |
$("#sendId").click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment