Here is what I am using for our projects:
$("#id-dialog").dialog({ modal: true, buttons: { 'Login': logIn, Cancel: logOut }, open: function() { $buttonPane = $(this).next(); $buttonPane.find('button:first').addClass('accept').addClass('ui-priority-primary'); $buttonPane.find('button:last').addClass('cancel').addClass('ui-priority-secondary'); } });
The first and last job in this case, since there are only two buttons. You can use: nth-child (index) if you have more than two buttons.
Another way to do this is to look at the parent element, which includes both the div element and the buttonpane div element, and then look for individual buttons in the parent element.
Joel D'Souza Apr 03 '10 at 22:17 2010-04-03 22:17
source share