提问者:小点点

工具提示没有隐藏,如果我们在单击时禁用了该按钮


工具提示没有隐藏,如果我们在单击时禁用了该按钮

$("#btn").on("click", function () {
  $(this).prop("disabled", true);
});

下面是一个运行示例。https://jsfidle.net/jitangupta/e8fjd0nl/

我正在使用bootstrap 4的基本设置


共2个答案

匿名用户

使用隐藏显示:

        $("#btn").on("click", function () {
            $(this).prop("disabled", true);
             $('[data-toggle="tooltip"]').tooltip('hide');
        });

匿名用户

只需使用单行代码来隐藏单击后的任何元素工具提示。

$(document).on("click","*[data-toggle='tooltip']",function(){$(this).tooltip('hide');});