Skip to content

Instantly share code, notes, and snippets.

@jonnykates
Created October 24, 2017 11:26
Show Gist options
  • Save jonnykates/cd1a7a7c835c972e9dec003dca375472 to your computer and use it in GitHub Desktop.
Save jonnykates/cd1a7a7c835c972e9dec003dca375472 to your computer and use it in GitHub Desktop.
// Make sure search form triggers on 'Enter'
$("#siteSearch").keydown(function(event) {
// enter has keyCode = 13, change it if you want to use another button
if (event.keyCode == 13) {
this.form.submit();
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment