jQuery Mobile 如何检查按钮是否被禁用? [英] jQuery Mobile how to check if button is disabled?

查看:32
本文介绍了jQuery Mobile 如何检查按钮是否被禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 jQuery Mobile 网页上禁用了这样的按钮:

I disable the button like this on my jQuery Mobile webpage:

$(document).ready(function() {
    $("#deliveryNext").button();
    $("#deliveryNext").button('disable');
});

我可以用

$("#deliveryNext").button('enable');

但是我如何检查按钮是否被禁用或启用?

But how do i check if the button is disabled or enabled?

此命令给出未定义":

$("#deliveryNext").attr('disabled')

一些想法?

我发现 $("#deliveryNext").button('disable') 只能接缝以更改按钮上的样式,之后点击工作正常,所以我需要禁用该按钮一些如何..我试过 .attr('disabled', 'disabled') 但是当我测试 .attr('disabled') 我得到未定义...

i find out that $("#deliveryNext").button('disable') only seams to change the style on the button, the clicking works fine after so i need to disable the button some how also.. i tried .attr('disabled', 'disabled') but when i then test .attr('disabled') i get undefined...

Edit2:在 How在 jQuery Mobile 中禁用链接按钮?

推荐答案

try :is 选择器

$("#deliveryNext").is(":disabled")

这篇关于jQuery Mobile 如何检查按钮是否被禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆