I'm using this plugin http://iamceege.github.io/tooltipster/.
It is possible know if a HTML already have the tooltipster initialized?
I wanna know because sometimes i need to change the text of the tooltip, and for do that, i need to destroy the tooltipster, change the attribute title of the HTML object, and initialize again. Like this:
$(this).tooltipster('destroy').attr("title", data.fields[i].value).tooltipster();
You can use the API:
Check if the element already has tooltipster:
$(...).hasClass("tooltipstered");
$(...).tooltipster('content', myNewContent);
Accepted solution does not work on SVG elements with tooltipster v4.1.6. This is how I solved it:
if ($.tooltipster.instances($(node)).length == 0) {
//it is NOT tooltipstered
}
else {
//it is tooltipstered
}
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