Get started with sweetalert2 CDN
MIT licensed
SweetAlert2: library for customizable, visually appealing alerts and modals.
Tags:- sweetalert
- sweetalert2
- alert
- modal
- popup
- prompt
- confirm
- toast
- accessible
Stable version
Copied!
How to start using sweetalert2 CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with sweetalert2 CDN - cdnhub.io</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.10.6/dist/sweetalert2.min.css">
</head>
<body>
<button id="alert-button">Show Alert</button>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.10.6/dist/sweetalert2.min.js"></script>
<script>
document.getElementById('alert-button').addEventListener('click', function() {
Swal.fire({
title: 'Are you sure?',
text: 'You won\'t be able to revert this!',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Yes, delete it!',
cancelButtonText: 'No, cancel!',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
Swal.fire('Deleted!', 'Your file has been deleted.', 'success')
}
})
})
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
10.16.11
11.10.0
11.10.1
11.10.2
11.10.3
11.10.4
11.10.5
11.10.6
11.10.7
11.10.8
11.11.0
11.11.1
11.12.0
11.12.1
11.12.2
11.12.3
11.12.4
11.13.0
11.13.1
11.13.2
11.13.3
*** 11.14.0
11.6.12
11.6.13
11.6.14
11.6.15
11.6.16
11.7.0
11.7.1
11.7.10
11.7.11
11.7.12
11.7.13
11.7.14
11.7.15
11.7.16
11.7.17
11.7.18
11.7.19
11.7.2
11.7.20
11.7.21
11.7.22
11.7.23
11.7.24
11.7.25
11.7.26
11.7.27
11.7.28
11.7.29
11.7.3
11.7.30
11.7.31
11.7.32
11.7.4
11.7.5
11.7.6
11.7.7
11.7.8
11.7.9
11.8.0
11.9.0
11.9.1
8.19.1
9.17.4