javascript - jQuery Mobile 如何检查按钮是否被禁用?

标签 javascript jquery jquery-ui jquery-mobile

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

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

我可以启用它

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

但是我如何检查按钮是禁用还是启用?

此命令给出“未定义”:

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

一些想法?

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

Edit2:更多关于我的“真实”问题的信息请访问 How to disable a link button in jQuery Mobile?

最佳答案

试试:is选择器

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

关于javascript - jQuery Mobile 如何检查按钮是否被禁用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6437187/

相关文章:

javascript - 网页上的热点/悬停区域

javascript - Vue.js - 滚动到不起作用的元素

JQuery AJAX 响应仅返回 [object Object] 且在 C# ASP.NET 中未定义

javascript - jquery UI Datepicker 日历和两个字段(备用)

asp.net-mvc - 对话框中的部分 View

javascript - 纯 Javascript 数组,使用显示数组的几个 html 按钮获取值

javascript - 如何在 wagtail richtextfiled 中添加自定义类

jquery - jQuery 中有没有办法将 div 放在前面?

javascript - 如何使用 javascript 从动画 gif 中提取帧?

javascript - 如何通过id从表中删除标签