Jquery 如何切换引导工具提示?
我想在单击按钮时切换工具提示。怎么办Jquery 如何切换引导工具提示?,jquery,html,twitter-bootstrap,Jquery,Html,Twitter Bootstrap,我想在单击按钮时切换工具提示。怎么办 <button class="btn btn-primary fa fa-plus" data-target="tooltip" title="show more"> </button> <script> $("button").click(function(){ $("button").toggleClass("fa-minus"); // what is the code
<button class="btn btn-primary fa fa-plus" data-target="tooltip" title="show more"> </button>
<script>
$("button").click(function(){
$("button").toggleClass("fa-minus");
// what is the code to toggle tool tip
});
</script>
$(“按钮”)。单击(函数(){
$(“按钮”).toggleClass(“fa减号”);
//切换工具提示的代码是什么
});
jsIDLE:您只需要更改按钮上的title属性
if ($("button").hasClass("fa-minus")) {
$("button").attr("title","show more");
}
else {
$("button").attr("title","show less");
}
单击按钮时如何再次切换?