How to use jQuery UI Tooltips to dynamically show Div containers based on a given attribute, other than title attribute ?
Fiddle Sample will show my problem :
I have different links, which can have a title attribute as well, and if there is a given attribute, Tooltip should read the value and show the contributing Div.
Sample:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span class="toolTipHTML" data-ttcontent="help1_content" title="test 1">Help 1</span>
<span class="toolTipHTML" data-ttcontent="help2_content" title="test 2">Help 2</span>
<div class="help1_content">
Text for Help 1 goes here!
<br>Lorem
<br>Ipsum
</div>
<div class="help2_content">
Text for Help 1 goes here!
<br>Lorem
<br>Ipsum
</div>
Currently it only shows the title attributes, which is the standard behavior. But I want to change the call this way, that I can see the Divs in a tooltip (the Divs only contain Text in this sample, but can be by far more complex in reality).
Updated fiddle.
You could use
content
option for this purpose :Hope this help.