select2 in sweetalert code example
Example: swal2 with select2
use HTML tag in swal and onOpen for initiating Select2
swal({
title: "Messaggio",
html: html,
confirmButtonColor: '#26C281',
confirmButtonText: 'Salva',
confirmButtonColor: '#26C281',
showCancelButton: true,
cancelButtonText: 'Chiudi',
cancelButtonColor: '#EF4836',
focusConfirm: false,
onOpen: function () {
$('.select2').select2({
minimumResultsForSearch: 15,
width: '100%',
placeholder: "Seleziona",
language: "it"
});
},