sweetalert tutorial code example
Example 1: sweet alert
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
Example 2: sweet alert
swal("Good job!", "You clicked the button!", "success");
Example 3: sweet alert
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
Example 4: 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!"); }});
Example 5: sweet alert example
swal("Here's a message!")
Example 6: sweetalert
<script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script>