How to avoid tooltips adding `title` & `data-original-title` attributes to DOM?
Created by: ricardopolo
In Bootstrap Tooltip.js you can use HTML data attributes to define title of the tooltip
<button data-toggle="tooltip" data-placement="left" title="Tooltip on left">Button</button>
And then using Javascript intialize it
$('[data-toggle="tooltip"]').tooltip()
We have a requirement where we need tooltips without modifiying the HTML (using data attributes). The tooltips are shown in the WYSIWYG Summernote editor and we don't want the user change them using the HTML editor.
So we initialize the tooltips using only Javascript. The title and the placement are specified using JS and not HTML.
$('[data-toggle="tooltip"]').tooltip({ 'placement': 'left' , 'title' : 'Toolt on left'})
It works. Shows the tooltip as expected but it changes the HTML adding this attributes to the element
data-original-title="" title=""
Do you know why this happen? Do you know if we can avoid this feature and not modifiy the HTML after the tooltip is shown? If not, can we work in a PR to avoid this feature?
Thanks