I am trying to use a selector to call the current script, but, of course, the property I need has been removed for some reason.
Is there a workaround for this? Here is basically what I want to accomplish:
(function($) { $.fn.myplugin = function(options) { return this.each(function() { console.log($(this).selector); }); } }(jQuery));
I need to see .theClassISelected (or some form of the original selector that I used to call the function) in the console, but since the selector property has been removed from jQuery, this is no longer possible.
I do not understand why this was removed. I have been looking for this problem for a long time, and all I see is StackOverflow answers from 2011-2012 recommending the selector property. I think it was useful at some point, but no more?
Scott
source share