Javascript Confirm Delete

Use a javascript confirm box to ask the user if they want to delete

function confirmDelete(delUrl) {
  if (confirm("Are you sure you want to delete")) {
    document.location = delUrl;

<a href="javascript:confirmDelete('')">Delete</a>
Another way

<a href="" onclick="return confirm('Are you sure you want to delete?')">Delete</a>

javascript confirm alert

Back To Top
© 1998 - 2024
Version 7.21 | Advertise on this site