Reputation: 10288
How to get the selector used to initialise a plugin within the plugin?
My first idea was to use $(this).attr('class');
but that would retrieve all classes set.
edit
$('.thisSelector').pluginName();
How can I retrieve this selector within the plugin?
Upvotes: 0
Views: 632
Reputation: 3415
Actually, within a plugin, there is no need to wrap "this" in a jQuery function, so it's just
this.selector
Sorry I don't have enough reputation to add this as a comment.
Upvotes: 0