Javascript Confirm Delete Code
Ohh, You are a web developer? Looking for a pop up Javascript confirmation for your delete or Edit Icon in your code in PHP or JSP or so. Here is what i suggest.
Option 1:
<a href="deletepage.php?id=1" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
Option 2:
<script> function confirmDelete(dUrl) { if (confirm("Are you sure you want to delete")) { document.location = dUrl; } } </script> <a href="javascript:confirmDelete('deletepage.php?id=1')">Delete</a>
I feel you would like to use the above one liner code 😉 It is best.