Skip to content Skip to sidebar Skip to footer

Easy Tooltip Content Change Via Javascript

Can you help me with changing the content of Easy Tooltip dynamically via Javascript? I tried almost everything: document.getElementById('easy_tooltip').innerHTML(tooltipContent);

Solution 1:

The way this plugin is built is to use the title attribute of your element, so you can rather update your HTML code like this :

<a href="#" id="tooltip-1" class="tooltip" title="Tooltip 1">Tooltip 1</a>
<br />
<a href="#" id="tooltip-2" class="tooltip" title="Tooltip 2">Tooltip 2</a>

(See this fiddle)

And if you need a dynamic content, you can always modify this attribute with jQuery :

$("#tooltip-1").attr("title", "mycontent");

Post a Comment for "Easy Tooltip Content Change Via Javascript"