buttons: { "Close": function() { $(this).dialog("close"); }
$("#mydialog").dialog({ buttons: { 'Confirm': function() { //do something $(this).dialog('close'); },'Cancel': function() { $(this).dialog('close'); } } });