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?
Jquery – Change Twitter Bootstrap Tooltip content on click
jquerytooltiptwitter-bootstrap
Related Topic
- Javascript – $(document).ready equivalent without jQuery
- Javascript – event.preventDefault() vs. return false
- Jquery – Bind a function to Twitter Bootstrap Modal Close
- Css – How to make Twitter Bootstrap menu dropdown on hover rather than click
- Jquery – Disallow Twitter Bootstrap modal window from closing
- Twitter-bootstrap – Twitter bootstrap modal-backdrop doesn’t disappear
- Javascript – How to return the response from an asynchronous call
- Css – Center a column using Twitter Bootstrap 3
Best Answer
Just found this today whilst reading the source code. So
$.tooltip(string)
calls any function within theTooltip
class. And if you look atTooltip.fixTitle
, it fetches thedata-original-title
attribute 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: