I'm using tooltipster
to generate tooltips, but I want to set the tooltip based on a data attribute from the element it's attached to. How do I get the associated data so I can set the image url as shown below. This is what I've been trying:
$(".test").tooltipster({
var datainfo = $(this).data("info");
content: $('<div class="desc"><img src="img/'+datainfo+'.jpg"/></div>')
});
My HTML is basically:
<div class="test tooltip" data-info="AAA">Testing</div>