Created
October 14, 2019 16:29
-
-
Save juanhuttemann/873d27e13cc8cb47c2f183f273f3ae76 to your computer and use it in GitHub Desktop.
set to selected option with Select2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var option = new Option("text", "1"); | |
option.selected = true; | |
$(".select2").append(option); | |
$(".select2").trigger("change"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment