jQuery delete confirmation box

前端 未结 9 883
粉色の甜心
粉色の甜心 2020-12-24 11:26

In my jQuery am displaying my results in a table formatted output, a part of my jQuery is



        
相关标签:
9条回答
  • 2020-12-24 12:06

    Try with this JSFiddle DEMO : http://jsfiddle.net/2yEtK/3/

    Jquery Code:
    
    $("a.removeRecord").live("click",function(event){
       event.stopPropagation();
       if(confirm("Do you want to delete?")) {
        this.click;
           alert("Ok");
       }
       else
       {
           alert("Cancel");
       }       
       event.preventDefault();
    
    });
    
    0 讨论(0)
  • 2020-12-24 12:07

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

    function deleteItem() {
        if (confirm("Are you sure?")) {
            // your deletion code
        }
        return false;
    }
    
    0 讨论(0)
  • 2020-12-24 12:11

    Update JQuery for version 1.9.1 link for deletion is here $("#div1").find('button').click(function(){...}

    0 讨论(0)
提交回复
热议问题