Get started with bootbox.js CDN

MIT licensed

Bootbox.js is a lightweight library for creating custom dialogs and modals.

Tags:
  • bootbox.js

Stable version

Copied!

How to start using bootbox.js CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with bootbox.js CDN - cdnhub.io</title>
    <!-- Include Bootbox.js CDN -->
    <script src="https://cdn.cdnhub.io/bootbox.js/6.0.0/bootbox.min.js"></script>
</head>
<body>
    <button id="showModal">Show Modal</button>

    <script>
        document.getElementById('showModal').addEventListener('click', function() {
            Bootbox.dialog({
                title: "Confirm Action",
                message: "Are you sure you want to perform this action?",
                buttons: {
                    confirm: {
                        label: "Yes, perform it!",
                        className: "btn-success",
                        action: function() {
                            console.log("Action confirmed");
                        }
                    },
                    cancel: {
                        label: "No, cancel it!",
                        className: "btn-danger"
                    }
                }
            });
        });
    </script>
</body>
</html>
Copied!
Copied!

All versions