1use HTML tag in swal and onOpen for initiating Select2
2swal({
3 title: "Messaggio",
4 html: html,
5 confirmButtonColor: '#26C281',
6 confirmButtonText: 'Salva',
7 confirmButtonColor: '#26C281',
8 showCancelButton: true,
9 cancelButtonText: 'Chiudi',
10 cancelButtonColor: '#EF4836',
11 focusConfirm: false,
12 onOpen: function () {
13 $('.select2').select2({
14 minimumResultsForSearch: 15,
15 width: '100%',
16 placeholder: "Seleziona",
17 language: "it"
18 });
19 },