I am creating a jQuery plugin that calls the on
method. Now I need to get the selector string from inside that method. Is there a way I can do that?
(function($) {
return this.each(function () {
var $this = $(this);
$(document).on('click', 'a[href="#post"]', function(event) {
event.preventDefault();
// I need to get the 'a[href="#post"]' string from here
});
});
}
})(jQuery);
Thanks you.