jQuery Ui Dialog Buttons, How to add class?

前端 未结 5 1464
花落未央
花落未央 2020-12-29 00:53

I found this answer on another thread..

How to add multiple buttons in Jquery UI dialog box?

Using this syntax, how do you add class to a particular button?<

5条回答
  •  情话喂你
    2020-12-29 01:45

    Use the open event handler:

    open: function(event) {
         $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('cancelButton');
     }
    

    Clean, simple, piece of cake!

提交回复
热议问题