I want to create a plugin that works like so:
var fmatted = $('someString').myFunction();
I’ve developed jQuery functions in the following manner:
$(someSelector).someFunction();
I know that the selector gets converted to a jQuery object and can be used via this in the plugin. However, if I want to use a string rather than a selector, I’m not sure how I can access that string within my plugin.
Basically, I want to be able to use a plugin to operate on something other than a selector, very much like jQuery’s .trim() function, but I can’t figure out how to access that within the plugin.
use the
selectorproperty: