“Question de SweetAlert” Réponses codées

Sweet Alert 2 Do Action on Confirm

Swal.fire({  
  title: 'Do you want to save the changes?',  
  showDenyButton: true,  showCancelButton: true,  
  confirmButtonText: `Save`,  
  denyButtonText: `Don't save`,
}).then((result) => {  
	/* Read more about isConfirmed, isDenied below */  
    if (result.isConfirmed) {    
    	Swal.fire('Saved!', '', 'success')  
    } else if (result.isDenied) {    
    	Swal.fire('Changes are not saved', '', 'info')  
 	}
});
Orbit Tuner

Sweetalisert

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>swal("My title", "My description", "success");</script>
Code Cat

Sweet Alert Bootstrap

Swal.fire(  'Good job!',  'You clicked the button!',  'success')
Brave Baboon

sweetalisert

swal("Good job!", "You clicked the button!", "error");
Uninterested Unicorn

Question de SweetAlert

swal({
  title: "Are you sure?",
  text: "Once deleted, you will not be able to recover this imaginary file!",
  icon: "warning",
  buttons: true,
  dangerMode: true,
})
.then((willDelete) => {
  if (willDelete) {
    swal("Poof! Your imaginary file has been deleted!", {
      icon: "success",
    });
  } else {
    swal("Your imaginary file is safe!");
  }
});
Grieving Grasshopper

Réponses similaires à “Question de SweetAlert”

Questions similaires à “Question de SweetAlert”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code