Javascript doubt sweetalert

0

I'm trying to use "sweetalert" to implement a confirm on a button that I have, but I understand how. for a normal confirmation I know I should use

onclick = "return confirm('mensaje')"

but when trying to implement sweetalert in a function

onclick="confirmar()"
<script>
function confirmar(){
swal({
  buttons: {
    cancel: true,
    confirm: true,
  },
});
}
</script>

I do not understand how it works .then to be able to return true or false and that my button is activated or not.

    
asked by Erick López Martinez 18.07.2018 в 03:37
source

0 answers