How to enable a jQuery Mobile button?

强颜欢笑 提交于 2019-12-12 02:26:40

问题


I'm using jQuery 1.6, and jQuery Mobile Beta 1. I have a jQuery Mobile themed button which I initialize as disabled. During a certain event, I'd like to enable the button. The following code is what I'd expect to work:

$("#id").prop("disabled", false);

But it seems like this doesn't propagate up to the jQuery Mobile wrapping DOM elements.


回答1:


The solution, per the jQuery Mobile docs page Form Plugins Method is as follows:

$('#id').button('enable');


来源:https://stackoverflow.com/questions/6497131/how-to-enable-a-jquery-mobile-button

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