I have a tooltip on an anchor element, that sends an AJAX request on click. This element has a tooltip (from Twitter Bootstrap). I want the tooltip content to change when the AJAX request returns successfully. How can I manipulate the tooltip after initiation?
Share
Just found this today whilst reading the source code. So
$.tooltip(string)calls any function within theTooltipclass. And if you look atTooltip.fixTitle, it fetches thedata-original-titleattribute and replaces the title value with it.So we simply do:
and sure enough, it updates the title, which is the value inside the tooltip.
A shorter way: