I had the same problem recently; in my case I needed to update a tooltip on the parent element of a select
whenever the selection changed (with the tooltip contents based on the title
element of the selected option
). To get the tooltip to update on an element, i.e. to get its contents to change, you need to:
remove the attribute that BT uses to store the original title (so that it doesn't think it's already handled the element),
set the element's title
attribute to the new content you wish to display in the updated tooltip,
call the bt()
function again to create the updated tooltip.
For instance:
element.removeAttr('bt-xtitle');
element.attr('title', 'new tooltip content');
element.bt();
Obviously this assumes that you're using the default title
attribute to generate the content, if you're using a custom contentSelector
like a div
, you'll need to adjust the code accordingly but the concept should remain the same.
Hopefully this can help someone trying to achieve the same thing, since it's not very intuitive how to do this.