我希望向一个元素添加一个类定义,该元素由button : { }
我如何做到这一点而不做类似 $('.ui-dialog-buttonpane button:eq(0)')
$(function() {
$( "#dialog-confirm" ).dialog({
resizable: false,
height:140,
modal: true,
buttons: {
//add a class definition to the delete all items button here. tried
//class:'save' didn't work
"Delete all items": function() {
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
});