jQuery delete confirmation box

前端 未结 9 974
粉色の甜心
粉色の甜心 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 11:57

    Try with below code:

    $('.close').click(function(){
    var checkstr =  confirm('are you sure you want to delete this?');
    if(checkstr == true){
      // do your code
    }else{
    return false;
    }
    });
    

    OR

    function deleteItem(){
        var checkstr =  confirm('are you sure you want to delete this?');
        if(checkstr == true){
          // do your code
        }else{
        return false;
        }
      }
    

    This may work for you..

    Thanks.

提交回复
热议问题