gpt4 book ai didi

jquery - UI 小部件禁用

转载 作者:行者123 更新时间:2023-11-28 00:10:27 25 4
gpt4 key购买 nike

我正在创建一个小部件,然后单击按钮我希望禁用该小部件。

(function ($) {
$.widget("df.txt", { })
})(jQuery);

$(document).ready(function () {
//register input widgets
$("input").txt({ disabled: true });


//Register button to disable/enable inputs
$("button").click(function () {
//$("input").txt("disable");
$("input").txt("option", "disabled", true);
});
});

我正在使用这个 link作为引用。

它不工作,有什么帮助吗?

最佳答案

试试这个

  $('input').attr("disabled", true);

or

$('input').attr("disabled", 'disabled');

这里我们将禁用属性设置为 true。

关于jquery - UI 小部件禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15496782/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com