sweet alert 2 do action on confirm

Solutions on MaxInterview for sweet alert 2 do action on confirm by the best coders in the world

showing results for - "sweet alert 2 do action on confirm"
Michela
12 Jan 2021
1Swal.fire({  
2  title: 'Do you want to save the changes?',  
3  showDenyButton: true,  showCancelButton: true,  
4  confirmButtonText: `Save`,  
5  denyButtonText: `Don't save`,
6}).then((result) => {  
7	/* Read more about isConfirmed, isDenied below */  
8    if (result.isConfirmed) {    
9    	Swal.fire('Saved!', '', 'success')  
10    } else if (result.isDenied) {    
11    	Swal.fire('Changes are not saved', '', 'info')  
12 	}
13});