When you click on one of the 'Delete' links in this example, you will be prompted to 'confirm' your action. This is a way of ensuring that items are not accidentally deleted, or the wrong item deleted by mistake.

When clicked on the link, then open confirmation box. if the user selects 'ok' then delete is done. if the user selects on 'no' or 'cancel' then not delete records.

See below example

// first example

<a href="delete.php?delete_id=<?php echo $row['id'];?>"  onclick="return confirm('Are you sure you want to delete this item?');">Delete</a> 


// second example

<a href="delete.php?delete_id=<?php echo $row['id'];?>" class="delete" data-confirm="Are you sure to delete this item?">Delete</a>

$('.delete').on("click", function (e) {
    e.preventDefault();

    var choice = confirm($(this).attr('data-confirm'));

    if (choice) {
        window.location.href = $(this).attr('href');
    }
});