When making a jQuery plugin, is it possible to accept a text string instead of an element?
For example, instead of
$("#someelement").myPlugin();:
$('Some text string').myPlugin();
Also, is it possible to allow multiple parameters?
For example, $('Text here', 'Another text').myPlugin();
I have been researching, and $() seems to be used only for selecting DOM elements. However, it's not possible to not use it. When I tried my test function using just $.myPlugin(); it didn't work.
Therefore, for this kind of thing should I just use a function? Are jQuery plugins only used when targeting a DOM element (ie. the $("p").greenify(); example). Or is it acceptable to use them like a regular function with params?