I have a code that generates a tooltip with a small message and makes it disappear after 2.5s.
var msg ="Oops! Essa é uma mensagem pequena";
$('#addItInfo').attr('data-original-title',msg);
$('#addItInfo').tooltip('show');
setTimeout( function(){
$('#addItInfo').tooltip('hide');
$('#addItInfo').removeAttr('title');
$('#addItInfo').removeAttr('data-original-title');
} , 2500 ); //Wait 2,5 seconds
The code works fine, however I would like to dynamically insert HTML elements within this tooltip, so I can bring some information from the database when the user hovers the mouse in the element that contains the tooltip. I ran a test with a div and so I turned this message off just for testing:
var msg ="Essa é uma mensagem teste <div>elemento div interno</div>";
Unfortunately the tooltip element does not make the display as expected.
Here is a small example of how I would like it. In this example I inserted a table inside the tooltip that is not bootstrap (just to test if it is possible ) and that it is not well formatted (it has other problems).
So my question is: how to insert html elements inside a bootstrap tootip? Any ideas?