assign id to jquery dialog button

后端 未结 5 1227
小蘑菇
小蘑菇 2021-01-30 10:49

How do i assign an an id to a jquery dialog button. I tried the following but it\'s not working

buttons: {
Ok: function() {
id=\"xyz\",
...
5条回答
  •  梦毁少年i
    2021-01-30 11:44

    This code from official site worked for me:

    $('#dialog').dialog({
        // properties ... 
        buttons: [{
            id:"btn-accept",
            text: "Accept",
            click: function() {
                $(this).dialog("close");
            }
        }, 
        {
            id:"btn-cancel",
            text: "Cancel",
            click: function() {
                $(this).dialog("close");
            }
        }]
    });
    

提交回复
热议问题