I am following the documentation and it is working wonders. However, using the iconColor
property
I get this error in the console: SweetAlert2: Unknown parameter "iconColor"
. How can I easily change the color of the icon? I could change the color using customClass
, but I would prefer to use iconColor
as shown in the documentation.
Javascript:
function Delete(e) {
swal.fire({
title: "Do you want to delete?",
text: " You will not be able to undo after deletion",
icon: "warning",
iconColor: "#000",
showCancelButton: true,
focusCancel: true,
confirmButtonColor: '#d33',
confirmButtonText: 'Yes, delete!',
cancelButtonColor: '#3085d6',
cancelButtonText: 'Cancel',
}).then((result) => {
if (result.isConfirmed) {
e.previousElementSibling.click();
}
});
}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<button onclick="Delete(this)" type="button" class="btn btn-sm btn-danger mt-2">Delete</button>