Developing plugins (adding setter functions)

Developing plugins (adding setter functions)

I've seen the basic plugin authoring howto on jQuery's page here,  http://docs.jquery.com/Plugins/Authoring and it's seems pretty straight forward, but there is one thing that it doesn't seem to cover, or I am just missing it. I've managed to create a working plugin such that I can call it with the familiar JQuery notation like so:

  1. $('element').myPlugin();

I've also manage to pass in options like so:

  1. $('element').myPlugin({
        foo: 1,
        bar: 'test'
    });

My question is how do I add setter functions such that I can do the following?

  1. $('element').myPlugin('foo', 5);