Skip to content

Instantly share code, notes, and snippets.

@davetayls
Created March 28, 2013 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davetayls/5264709 to your computer and use it in GitHub Desktop.
Save davetayls/5264709 to your computer and use it in GitHub Desktop.
jquery.enterPress
/**
jQuery.enterPress
@license The MIT License (MIT)
*/
(function($){
'use strict';
$.fn.enterPress = function() {
return this.keypress(function(e) {
if (e.which == 13) {
$(this).trigger('enterPress');
}
});
};
}(window.jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment