I want to change an option's text on the fly. The HTML can be changed easily by:
$('option[value=custom-pub]').text("New Text For Pub");
How can I force select2 to refresh the text? I don't want to destroy()
and create the select2 object from scratch, because I want the user selection to stay selected.
Simply
$("select").select2();
works.