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.