How to enable Bootstrap tooltip on disabled button?

后端 未结 18 2459
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 23:18

I need to display a tooltip on a disabled button and remove it on an enabled button. Currently, it works in reverse.

What is the best way to invert this behaviour?

18条回答
  •  清酒与你
    2020-11-29 00:12

    Simply add the disabled class to the button instead of the disabled attribute to make it visibly disabled instead.

    
    

    Note: this button only appears to be disabled, but it still triggers events, and you just have to be mindful of that.

提交回复
热议问题