Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Created April 3, 2014 14:43
Show Gist options
  • Select an option

  • Save codeBelt/9955653 to your computer and use it in GitHub Desktop.

Select an option

Save codeBelt/9955653 to your computer and use it in GitHub Desktop.
jQuery Plugin with reference
var PluginName = function(element) {
this.element = element;
};
PluginName.prototype.update = function() {
};
$.fn.myPlugin = function() {
this.myPluginId = 0;
return new PluginName(this);
};
var $myForm = $('el').myPlugin();
$myForm.update();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment