Jquery: creating plugins

(function($){

  $.fn.extend({
    yourPluginName: function(options) {
      var defaults = {
        yourDefaults: 'here',
                   anotherDefault:  ‘here’
      }
              // This way, what you pass as args overwrite your defaults:
      var options =  $.extend(defaults, options);
        returnselect;
      // ...And then, your functionality here...
    }
  });
})(jQuery);
$(‘#someSelector’).yourPluginName({yourOptions:’here’});