Skip to content

Instantly share code, notes, and snippets.

@nathggns
Forked from cdl/jquery.shush.js
Last active December 25, 2015 02:49
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 nathggns/6905514 to your computer and use it in GitHub Desktop.
Save nathggns/6905514 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.shush = function($btn) {
// First, validation
// Cache global variables
var $form = $(this);
// Default $btn to input[type=submit]
$btn = $btn || 'input[type=submit]';
if (!($btn instanceof jQuery)) {
$btn = $form.find($btn);
}
// Limit it to 1
$btn = $btn.eq(0);
// Get the btn type
var btnType = $btn[0].nodeName.toLowerCase();
};
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment