小编nic*_*omb的帖子

将类添加到jquery对话框按钮

我想在jquery对话框的按钮上添加css类.

这是我的代码:

$(document).ready(function(){
      $('#messageBox p').html('bla bla bla. Ok?'); 
      $('#messageBox').dialog({
        modal : true,
        buttons: {
          'Yes': function() {
            doSomething();
            $(this).dialog('close');
          }, 
          'No': function() {
            doAnotherThing();
            $(this).dialog('close');
          }
        }
      });
    });
Run Code Online (Sandbox Code Playgroud)

例如,我想在"是"按钮上添加".red"类.

我怎样才能做到这一点?

谢谢!

css jquery class

21
推荐指数
3
解决办法
3万
查看次数

标签 统计

class ×1

css ×1

jquery ×1