When calling a custom plugin, how can I get the current selector string?
$(\'my_selector p\').my_plugin();
Would like to output my_se
my_se
Best workaroud is
function mySelector(selector) { return $.extend($(selector),{"selector":selector}); }
this returns classic jquery object as $() would
mySelector(".myClass")
and this returns string of the selector
mySelector(".myClass").selector