The example in this article describes the jquery UI plug-in custom Confirm confirmation box method. Share to everyone for your reference. The specific analysis is as follows:
This code customizes a confirm confirmation dialog box effect through the jquery UI, and customizes the Confirm box button by customizing the dialog box's display interface and appearance through the HTML code, in this case a confirm confirmation button and a Cancel button are defined.
HTML code
<button id= "callconfirm" >Confirm!</button>
<div id= "dialog" title= "Confirmation Required" >
Are you sure about this?
</div>
JS Code:
$ ("#dialog"). Dialog ({
autoopen:false,
modal:true,
buttons: {"
Confirm": function () {
alert (" Have confirmed! ");
},
" Cancel ": function () {
$ (this). dialog (' Close ');}
}
);
$ ("#callConfirm"). On ("click", Function (e) {
e.preventdefault ();
$ ("#dialog"). Dialog ("Open");
I hope this article will help you with your jquery programming.