i would like to change the class of the button in the dialog in Jquery UI
i have tried something like this. but it doesnt work
- $('#dialog').dialog({
- autoOpen: false,
- width: 600,
- buttons: {
- "Ok": function () {
- $(this).dialog("close");
- },
- "Cancel": function () {
- $(this).dialog("close");
- }
- }, open: function (event, ui) {
- // Get the dialog
- var dialog = $(event.target).parents(".ui-dialog.ui-widget");
- // Get the buttons
- var buttons = dialog.find(".ui-dialog-buttonpane").find("button");
- var okButton = buttons[0];
- var cancelButton = buttons[1];
- $(okButton).removeClass();
- // Add class to the buttons
- // Add class to the buttons
- $(okButton).addClass("greenbtn");
- $(cancelButton).addClass("greenbtn");
- }
- });