jQuery delete confirmation box

jquery

Solution

You need to add confirm() to your deleteItem();

function deleteItem() {
    if (confirm("Are you sure?")) {
        // your deletion code
    }
    return false;
}

Problem

In my jQuery am displaying my results in a table formatted output, a part of my jQuery is ``` <td class='close' onclick='deleteItem(#ITEMID,#ITEMNAME)'></td> ``` here `"close"` is a CSS class and in this class I have cross mark image, if I click this cross mark the function(deleteItem) will be fired. here what I want to do is if I click this cross mark a `"delete confirmation box"` should pop up and if I click yes this onclick event should fire, else if I click No nothing should happen. How can I achieve this, can anyone help me....

Original source