They explained an example of how to open a drop-down list.
Documentation URL: https://select2.imtqy.com/examples.html and check the section Programmatic access.
HTML part:
<select id="e1">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<br>
<br>
<input type="text" id="nameID" name="firstname">
jQuery part:
$("#e1").select2();
$("input").on("change", function () {
$("#e1").select2("open");
});
$( "input" ).focus(function() {
$("#e1").select2("open");
});
Try this example with the onChange event: http://jsfiddle.net/mananpatel/73wypp1w/5/
, :)