[Demo] jQuery UI Confirm Dialog Box

[Demo] jQuery UI Confirm Dialog Box

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/smoothness/jquery-ui.css">
<input type="button" id="btnOpenDialog" value="Open Dialog" />
<div id="dialog-confirm"></div>

JavaScript

function fnOpenNormalDialog() {
    $("#dialog-confirm").html("Confirm Dialog Box");

    // Define the Dialog and its properties.
    $("#dialog-confirm").dialog({
        resizable: false,
        modal: true,
        title: "Modal",
        height: 250,
        width: 400,
    buttons: [
        { text: "Save", click: function () { alert("save"); }, 				}
        { text: "Cancel", click: function () { $("#dialog-confirm").dialog('close');}, style:"margin-left:10px;" }
    ]
    });
}

$('#btnOpenDialog').click(fnOpenNormalDialog);