<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/ui-lightness/jquery-ui.css">
<div id="dialog-confirm" title="Empty the recycle bin?">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>These items will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
CSS
body{
font-size: 10px;
}
JavaScript
allowed = true;
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
Proceed: function() {
allowed = true;
$(this).dialog("close");
},
Cancel: function() {
allowed = false;
$(this).dialog("close");
}
}
});
if (allowed){
$('body').append("<div>The action was allowed!</div>");
} else {
$('body').append("<div>The action was allowed!</div>");
}
var answer2 = confirm("Proceed?");
if (answer2){
$('body').append("<div>The action2 was allowed!</div>");
} else {
$('body').append("<div>The action2 was allowed!</div>");
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!