How to show confirm box in jQuery?

In some cases, in the project, we need confirmation from the users. like if users are trying to delete any data from the database. to confirm that want to delete the data. we can use the jQuery confirm box. and where the user can confirm his choise.

jQuery confirm(), which displays a prompt and returns true or false based on what the user decided:

if (confirm('Are you sure you want to save this thing into the database?')) {
  // Save it!
  console.log('Thing was saved to the database.');
} else {
  // Do nothing!
  console.log('Thing was not saved to the database.');
}