I don't know for what reason but in tooltipster html content won't display. I encoded the html, added the option in the script but still a string.
$(document).ready(function() {
$('.tooltip').tooltipster({
contentAsHTML: true,
interactive: true,
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://iamceege.github.io/tooltipster/js/jquery.tooltipster.js"></script>
<link rel="stylesheet" href="http://iamceege.github.io/tooltipster/css/tooltipster.css">
<span title="&lt;img src=&quot;my-image.png&quot; /&gt; &lt;strong&gt; This text is in bold case !&lt;/strong&gt;" class="tooltip">Why is this not working</span>
Your title attribute has a bunch of instances of &
where it should just be &
.
For example, you have:
&lt;img src=&quot;my-image.png&quot; /&gt;
When it should be:
<img src="my-image.png" />
I'm not sure how you generated your title attribute, it looks like you may have escaped the string twice.
Working snippet:
$(document).ready(function() {
$('.tooltip').tooltipster({
contentAsHTML: true,
interactive: true,
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://iamceege.github.io/tooltipster/js/jquery.tooltipster.js"></script>
<link rel="stylesheet" href="http://iamceege.github.io/tooltipster/css/tooltipster.css">
<span class="tooltip" title="<img src="my-image.png" /> <strong> This text is in bold case !</strong>">This is working</span>