disable <button> with jQuery Mobile causes frame

冷暖自知 提交于 2019-12-02 04:39:06

To disable a button or a tags, add class ui-state-disabled. Use .button() widget only with input that has type button, submit or reset.

When you use .button() on any element other than input, you convert it into an input button and hence you get a wrapper around it.

  • Disable/Enable an input button:

    $(".selector").button("disable");
    $(".selector").button("enable");
    
  • Disable/Enable button tag:

    $(".selector").addClass("ui-state-disabled");
    $(".selector").removeClass("ui-state-disabled");
    
  • Disable/Enable a anchor tag:

    $(".selector").addClass("ui-state-disabled");
    $(".selector").removeClass("ui-state-disabled");
    

Demo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!