Refresh an element so its new tooltip shows (in jQuery/Javascript)

后端 未结 4 1021
挽巷
挽巷 2021-01-12 06:54

I have an html element which is using bootstrap tooltip to show a title when hovering over it. However, when you click this element I\'m changing the tooltip, but the new to

4条回答
  •  孤城傲影
    2021-01-12 07:49

    You can use this code:

    var newTooltip = 'Changed this tooltip!';
    $('#example').attr('data-original-title', newTooltip).parent().find('.tooltip-inner').html(newTooltip);
    

    I test it with bootstrap 3.3.4 here you can see it: http://jsfiddle.net/NabiKAZ/a4WwQ/1029/

提交回复
热议问题