Get started with sweetalert CDN

MIT licensed

SweetAlert is a popular library for displaying customizable and visually appealing alert boxes.

  • alert
  • modal
  • sweetalert
  • popup
  • dialog
  • ui

Stable version


How to start using sweetalert CDN

<!DOCTYPE html>
  <title>Get started with sweetalert CDN -</title>
  <link rel="stylesheet" href="">
  <button id="alert-button">Show Alert</button>

  <script src=""></script>
    document.getElementById('alert-button').addEventListener('click', function() {{
        title: 'Are you sure?',
        text: 'This action cannot be undone!',
        icon: 'warning',
        showCancelButton: true,
        confirmButtonText: 'Yes, delete it!',
        cancelButtonText: 'No, cancel!',
        reverseButtons: true
      }).then((result) => {
        if (result.isConfirmed) {
'Deleted!', 'Your file has been deleted.', 'success')

All versions