Change Twitter Bootstrap Tooltip content on click

前端 未结 25 1291
情深已故
情深已故 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:28

    I'm using this easy way out:

    $(document).ready(function() {
        $("#btn").prop('title', 'Click to copy your shorturl');
    });
    
    function myFunction(){
      $(btn).tooltip('hide');
      $(btn).attr('data-original-title', 'Test');
      $(btn).tooltip('show');
    });

提交回复
热议问题