1 if (confirm('Are you sure ?')) {
2 console.log('ok');
3 }else
4 {
5 console.log('cancel')
6 }
1$.confirm({
2 title: 'Confirm!',
3 content: 'Simple confirm!',
4 buttons: {
5 confirm: function () {
6 $.alert('Confirmed!');
7 },
8 cancel: function () {
9 $.alert('Canceled!');
10 },
11 somethingElse: {
12 text: 'Something else',
13 btnClass: 'btn-blue',
14 keys: ['enter', 'shift'],
15 action: function(){
16 $.alert('Something else?');
17 }
18 }
19 }
20});
1$("#complexConfirm").confirm({
2 title:"Delete confirmation",
3 text:"This is very dangerous, you shouldn't do it! Are you really really sure?",
4 confirm: function(button) {
5 alert("You just confirmed.");
6 },
7 cancel: function(button) {
8 alert("You aborted the operation.");
9 },
10 confirmButton: "Yes I am",
11 cancelButton: "No"
12});
1<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css">
2<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>