Change Twitter Bootstrap Tooltip content on click

前端 未结 25 1295
情深已故
情深已故 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 "

    "+$("#tooltipcontainer").html()+"

    "; } });

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

提交回复
热议问题