I am trying to use select2 but my function is not detected, the following$('#departamento').on('change', function () {
var data = $(".select2 option:selected").text();
console.log(data);
})
also try the following$('#departamento').on('select2:select', function (e) {
var data = e.params.data;
console.log(data);
});