Sweet Alert Message in HTML


<!DOCTYPE html>

<html>

<head>

    <title>SweetAlert Example</title>

    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

</head>

<body>

    <button onclick="showSweetAlert()">Click me</button>


    <script>

        function showSweetAlert() {

            swal({

                title: "Are you sure?",

                text: "Do you want to continue?",

                icon: "warning",

                buttons: ["Cancel", "OK"],

            }).then((value) => {

                if (value) {

                    swal("Great!", "You pressed OK!", "success");

                } else {

                    swal("Cancelled", "You pressed Cancel!", "error");

                }

            });

        }

    </script>

</body>

</html>

Comments

Popular posts from this blog

₹2.5 Lakh ki Alkaline Machine: Investment Ya Hype?" Japan Technology Wale Alkaline Water Systems: Science Ya Sirf Marketing? "Alkaline Water Machines — Health Ke Naam Par Business?

How to Write "M Squared" (M²) in C#