Created
January 16, 2019 18:28
-
-
Save thisisnic/a057d9bf96f65a968d49ebd5c4ced791 to your computer and use it in GitHub Desktop.
JavaScript for "enter" key when focussed on a text field triggering activation of button
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
$(document).keyup(function(event) { | |
if ((event.keyCode == 13) && (document.activeElement.id == "login_password")) { | |
$("#login_button").click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment