This belong to codes prior to select2 version 4
I have a simple code of select2 that get data from ajax
select2
var $option = $("").val('1').text("Pick me"); $('#select_id').append($option).trigger('change');
Try this append then select. Doesn't duplicate the option upon AJAX call.