I want to hide or show my select2, but I can't find a method in the API. I'm using a workaround, hiding the parent, like this:
$(document).on('change', '.country', function () {
if ($(this).val() == $(this).data('current-countryCode')) {
$('#states').parent().show();
}
else {
$('#states').parent().hide();
}
});
But I'd like to know if anyone could help or if even exists such a method in the API.