gpt4 book ai didi

jquery - 将 id 分配给 jquery 对话框按钮

转载 作者:行者123 更新时间:2023-12-03 21:29:58 24 4
gpt4 key购买 nike

如何为 jquery 对话框按钮分配 id。我尝试了以下方法,但不起作用

buttons: {
Ok: function() {
id="xyz",
...

最佳答案

以下内容(似乎未记录)适用于 jQuery 1.8.9:

$("#dlg").dialog({
buttons : {
"MyButton" : {
text: "My Button",
id: "my-button-id",
click: function(){
alert("here");
}
}
}
});

该按钮可以通过 $("#my-button-id") 进行寻址

关于jquery - 将 id 分配给 jquery 对话框按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4929394/

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