我有一个默认禁用的剑道开关:
<input type="checkbox" id="notifications-switch" aria-label="Notifications Switch" disabled="disabled" />
我有一个复选框,默认情况下未选中,我想通过选中该复选框来启用开关,这是复选框:
<input type="checkbox" id="eq1" class="k-checkbox">
这是想要但不起作用的,当我检查它时,它没有启用开关:
$("#eq1").change(function () {
if (this.checked) {
$("#notifications-switch").is(":disabled") = false;
}
});
最佳答案
在剑道中为了实现启用禁用,应使用以下内容(关于我的问题):
$("#notifications-switch").data("kendoMobileSwitch").enable(true);
关于jquery - 如何通过选中和取消选中复选框来启用或禁用开关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51944748/