confirm javascript onclick code example
Example 1: a href confirm javascript
<a href="delete.php?id=22" onclick="return confirm('Are you sure?')">Link</a>
Example 2: are you sure you want to proceed click ok button javascript code
var result = confirm("Want to delete?");
if (result) {
//Logic to delete the item
}