Change Twitter Bootstrap Tooltip content on click

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

    You can set content on tooltip call with a function

            $("#myelement").tooltip({
                "title": function() {
                    return "<h2>"+$("#tooltipcontainer").html()+"</h2>";
                }
            });
    

    You don't have to use only the title of the called element.

    0 讨论(0)
提交回复
热议问题