Change Twitter Bootstrap Tooltip content on click

前端 未结 25 1298
情深已故
情深已故 2020-11-27 10:02

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 th

25条回答
  •  借酒劲吻你
    2020-11-27 10:25

    For bootstrap 3.x

    This seems like cleanest solution:

    $(element)
      .attr('data-original-title', 'New title').tooltip('show')
    

    Show is used to make title update right away and not wait for tooltip to be hidden and shown again.

提交回复
热议问题