-2

How could I cancel my function on the else? I tried to use alert, text, but even if that show me the text, the member is still delete after that.

<div class="show_n_react_div_deux">
  <a onclick="deleteUser()" id="ban" href="ban.php?id=<?php echo $user['id']; ?>"><img src="../images/delete.png" width="50"></a>
  <script>
    function deleteUser() {
      let text = "are you sure you want to delete this member?";

      if (confirm(text) == true) {
        text = "You pressed OK!";
      } else {
        cancel(deleteUser());
      }
    }
  </script>
</div>
                   

view :

enter image description here

0 Answers0