sweetalert2 css code example
Example 1: sweet alert
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
Example 2: sweet alert js
swal({
title: "Deleted!",
text: "Your row has been deleted.",
button: "Close",
icon: "success",
timer: 3000,
buttons: {
confirm: {
text: "OK",
value: true,
visible: true,
className: "",
closeModal: true
},
cancel: {
text: "Cancel",
value: false,
visible: true,
className: "",
closeModal: true,
}
}
});
Example 3: alert sweetalert2
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
Example 4: sweetalert2
const { value: email } = await Swal.fire({ title: 'Input email address', input: 'email', inputLabel: 'Your email address', inputPlaceholder: 'Enter your email address'})if (email) { Swal.fire(`Entered email: ${email}`)}