How to reference jdialog button

How to reference jdialog button

If I have a button generated via the jdialog option like below, how can I reference it and disable it from its own onclick function? Thanks!

  1.                $("#myDiv").dialog({
                    autoOpen: false,
                    height: 205,
                    width: 400,
                    modal: true,
                    resizable: false,
                    buttons: {
                        "Add": function() {     
                            //disable add button here                      
                        },
                        Cancel: function() {
                            $(this).dialog("close");                                                  
                        }
                    },