Jquery对话框将自定义类添加到按钮

Jquery对话框将自定义类添加到按钮,jquery,html,dialog,Jquery,Html,Dialog,我希望将类定义添加到使用按钮:{}创建的元素中,如何在不执行类似$('.ui对话框按钮按钮:eq(0)')之类的操作的情况下执行此操作 可以使用option对象指定类名 $("#dialog-confirm").dialog({ resizable: false, height: 140, modal: true, buttons: { //add a class definition here.

我希望将类定义添加到使用
按钮:{}
创建的元素中,如何在不执行类似
$('.ui对话框按钮按钮:eq(0)')之类的操作的情况下执行此操作


可以使用option对象指定类名

$("#dialog-confirm").dialog({
        resizable: false,
        height: 140,
        modal: true,
        buttons: {
            //add a class definition here.
            "Delete all items": {
                'class': 'customClass', //<-- specify the class here
                text: 'Delete all items', //<-- text for the button
                click: function () { //click handler
                    $(this).dialog("close");
                }
            },
            Cancel: function () {
                $(this).dialog("close");
            }
        }
    });
$(“#对话框确认”)。对话框({
可调整大小:false,
身高:140,
莫代尔:是的,
按钮:{
//在这里添加一个类定义。
“删除所有项目”:{

'class':'customClass',/您可以使用option对象指定类名

$("#dialog-confirm").dialog({
        resizable: false,
        height: 140,
        modal: true,
        buttons: {
            //add a class definition here.
            "Delete all items": {
                'class': 'customClass', //<-- specify the class here
                text: 'Delete all items', //<-- text for the button
                click: function () { //click handler
                    $(this).dialog("close");
                }
            },
            Cancel: function () {
                $(this).dialog("close");
            }
        }
    });
$(“#对话框确认”)。对话框({
可调整大小:false,
身高:140,
莫代尔:是的,
按钮:{
//在这里添加一个类定义。
“删除所有项目”:{

'class':'customClass',/您可以使用option对象指定类名

$("#dialog-confirm").dialog({
        resizable: false,
        height: 140,
        modal: true,
        buttons: {
            //add a class definition here.
            "Delete all items": {
                'class': 'customClass', //<-- specify the class here
                text: 'Delete all items', //<-- text for the button
                click: function () { //click handler
                    $(this).dialog("close");
                }
            },
            Cancel: function () {
                $(this).dialog("close");
            }
        }
    });
$(“#对话框确认”)。对话框({
可调整大小:false,
身高:140,
莫代尔:是的,
按钮:{
//在这里添加一个类定义。
“删除所有项目”:{

'class':'customClass',/您可以使用option对象指定类名

$("#dialog-confirm").dialog({
        resizable: false,
        height: 140,
        modal: true,
        buttons: {
            //add a class definition here.
            "Delete all items": {
                'class': 'customClass', //<-- specify the class here
                text: 'Delete all items', //<-- text for the button
                click: function () { //click handler
                    $(this).dialog("close");
                }
            },
            Cancel: function () {
                $(this).dialog("close");
            }
        }
    });
$(“#对话框确认”)。对话框({
可调整大小:false,
身高:140,
莫代尔:是的,
按钮:{
//在这里添加一个类定义。
“删除所有项目”:{
“类”:“自定义类”//