In jQuery, how can I check whether a specific plugin is active on an element? Alternatively, can I get a list of which elements a specific plugin has been applied to?
I have no control of the plugin's code. I've tried checking a property like
$("#example").fancybox
but this property exists for every element, regardless of whether the plugin has been applied.
Thanks!
There is no obligation for a plugin to advertise to the outside world the fact that it has augmented an element.
That said, many plugins (including anything that uses the jQuery UI widget factory) register their names with the element using jQuery's data() facility. Then again, not all plugins do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With