Question: How can I achieve this?

1. A user clicks the delete link (with a class of "confirm").
2. Confirmation message appears asking "Are you sure?" with "Yes" and "Cancel" options.

If yes is selected, the link continues as clicked, but if cancel is selected, the action is canceled.

**Update:** Final working code with `confirm()` thanks to [this guy](https://stackoverflow.com/questions/1844351/how-to-disable-click-with-jquery-javascript/1844412#1844412):

```
$('.confirm').click(function() {
    return confirm("Are you sure you want to delete this?");
});

```

Answer: 
Javascript provides a builtin confirmation dialog.

```
if (confirm("Are you sure?"))
{
    // continue with delete
}

```
in my experience this is the best and easiest way to have a confirmation!

> 
> 
> ```
> <a href="#" onclick="return myconfirm()">Confirm</a>
> <script>
> function myconfirm()
> {
>     if(confirm('Are You Sure ...'))
>         return true;
>     return false;
> }
> </script>
> 
> ```
> 
>