Delete Confirmation Message using JavaScript

AuthorHariom Prajapati

Pubish Date23 Jun 2022


In this tutorial we will see how to show delete confirmation message using JavaScript. Delete confirmation message is always important because if you do not show any confirmation message before deleting then if user click on delete button by mistake then the data will directly delete. So, always show a confirmation message to user before deleting any data.


Delete Confirmation Message using JavaScript


Delete confirmation message using javaScript

Here we will use JavaScript confirm() method to show confirmation message before delete.


For example - 

<!DOCTYPE html>

    <title>How to Show Delete Confirmation Message using JavaScript</title>
    <script src=""></script>

    <img src=""
    <!-- delete confermation alert in html   -->
    <a href="url_to_delete" onclick="return confirm('Are you sure you want to delete this item?');"><button>Delete





Comments 0

Leave a comment