How to show a confirm message before delete?
Solution 1:
Write this in onclick
event of the button:
var result = confirm("Want to delete?");
if (result) {
//Logic to delete the item
}
Solution 2:
You can better use as follows
<a href="url_to_delete" onclick="return confirm('Are you sure you want to delete this item?');">Delete</a>