-
-
Save illusi03/73957beed3f5184a6cf4bfc61bcb879a to your computer and use it in GitHub Desktop.
[Ctrl] + [Enter] to Submit Forms
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.body.addEventListener('keydown', function(e) { | |
if(!(e.keyCode == 13 && (e.metaKey || e.ctrlKey))) return; | |
var target = e.target; | |
if(target.form) { | |
target.form.submit(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment