Javascript 引导工具提示更改

Javascript 引导工具提示更改,javascript,twitter-bootstrap,Javascript,Twitter Bootstrap,单击按钮时是否可以更改某些元素的工具提示? DIV带有一些工具提示DIV 按钮 用户单击按钮后: DIV和其他工具提示DIV 按钮我写了这篇文章,但它没有引导工具提示 $(".switch").click(function() { $(".tooltip").toggle(); if ($("#tp1").text() == "Active") { $("#tp1").text("Stop"); } else

单击按钮时是否可以更改某些元素的工具提示?
DIV
带有一些工具提示
DIV
按钮

用户单击按钮后:
DIV
和其他工具提示
DIV

按钮

我写了这篇文章,但它没有引导工具提示

$(".switch").click(function() {
        $(".tooltip").toggle();
        if ($("#tp1").text() == "Active") {
            $("#tp1").text("Stop");
        }
        else {
            $("#tp1").text("Active");
        }
    });

<div class="switch">
    <input type="checkbox">
    <label><i class="glyphicon glyphicon-off"></i></label>
</div> <div class="tooltip fade bottom in" style="display: block;top: 52px;width: 115px;left: 16.5px;"><div class="tooltip-arrow"></div><div id="tp1" class="tooltip-inner">Active</div></div>
$(“.switch”)。单击(函数(){
$(“.tooltip”).toggle();
如果($(“#tp1”).text()=“活动”){
$(“#tp1”)。文本(“停止”);
}
否则{
$(“#tp1”).text(“活动”);
}
});
活跃的

我为您准备了一个最好的工作代码!试试下面的代码

$(函数(){
var$toolTip=$(“#工具提示示例”);
var originalttle=$toolTip.attr('title');
$toolTip.toolTip({placement:“bottom”});
$toolTip.单击(函数(){
$toolTip.attr('title','newhelloworld Message')。toolTip('fixttitle')。toolTip('show');
});
$(document).on(“mouseout”,工具提示示例),function()
{
$toolTip.attr('title',originaltile.).toolTip('fixtile').toolTip('show');
});
});


单击我
请添加您目前的进度代码。