【发布时间】:2016-11-18 04:46:57
【问题描述】:
我在 jquery 中创建了一个对话框。并且有一个名为“保存”的按钮。我需要在这个保存按钮上添加一个 id。我怎样才能在 jquery 中实现这一点。这是我的代码
$(function() {
$( "#dialog" ).dialog({
height: 400,
width: 650,
modal: true,
buttons: {
Save: function() {
dialog.dialog( "close" );
}
},
close: function() {
form[ 0 ].reset();
allFields.removeClass( "ui-state-error" );
}
});
});
【问题讨论】:
-
试试这个
Save: { id: 'Save', click: function() { dialog.dialog( "close" ); } }
标签: javascript jquery html