javascript confirm example

JavaScript
var r = confirm("Are you sure you want to delete?");
if (r == true) {
  //delete
} else {
  //don't delete
}
Source

Also in JavaScript: