I am using the following code:
$(".select2")
.select2();
All the select2 classes have the the .select2() applied to them.
However I have code that adds html (including selects to my web page. Do I need to run the same code above after the new content is added?
Yes you would need to rerun this method to style the new
selectelements.Depending upon how you are adding the
selectelements it is probably worth adding in this method into the callback.As an example using ajax: