📜  由变量设置的 jquery 对话框按钮文本 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:04.480000             🧑  作者: Mango

代码示例1
$("#dialog_box").dialog({
    autoOpen: false,
    modal: true,
    resizable: false,
    buttons: [{
        text: "Ok",
        "id": "btnOk",
        click: function () {
            //okCallback();
        },

    }, {
        text: "Cancel",
        click: function () {
            //cancelCallback();
        },
    }],
    close: function () {
        //do something
    }
});

var newLabel = "Updated Label";
$("#btnOk").html(''+ newLabel +'')