Answers for "download sweetalert js"

1

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')  
 	}
});
Posted by: Guest on December-03-2020
0

sweetalert2 js

<link href="//cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css" rel="stylesheet">
<script src="//cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.js"></script>
Posted by: Guest on January-05-2021

Browse Popular Code Answers by Language