The example in this article describes how to customize the confirm confirmation box using the jQuery UI plug-in. Share it with everyone for your reference. The specific analysis is as follows:
This code customizes the effect of a confirm confirmation dialog box through jQuery UI. The display interface and appearance of the dialog box are customized through html code. The button of the confirm box can be customized. In this example, a confirm confirmation button is defined. and a cancel button.
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("You have confirmed!"); }, "Cancel" : function() { $(this).dialog("close"); } } }); $("#callConfirm").on("click", function(e) { e.preventDefault(); $("#dialog").dialog("open"); });
I hope this article will be helpful to everyone’s jQuery programming.