If you want to use jquery then you include Jquery in your page and define following function
function confirmation(question) {
var defer = $.Deferred();
$('<div></div>')
.html(question)
.dialog({
autoOpen: true,
modal: true,
title: 'Confirmation',
buttons: {
"Accept": function () {
defer.resolve("true");//this text 'true' can be anything. But for this usage, it should be true or false.
$(this).dialog("close");
},
"Deny": function () {
defer.resolve("false");//this text 'false' can be anything. But for this usage, it should be true or false.
$(this).dialog("close");
}
}
});
return defer.promise();
};
Then use it in following way
confirmation('Do you want to continue on this website?').then(function (answer) {
if (answer == "false") {
// your logic
}
else if (answer == "true") {
// your logic
}
});