The div with id of ‘attributes’ is static.
All the element inside it are dynamically created.
When the div with id ‘add-color’ is clicked,
then the div of id ‘showform’ becomes visible on the page.
Problem is, the select element with id of ‘addnewcolor’ is not converted to select2.
I am also using the select2 bootstrap theme.
<div id="attributes">
<div class="right fake-link" id="add-color">Add color</div>;
<div class="form-group row" id="showform" style="display:none">
<label class="col-xs-3 col-form-label" style="">Color:</label>
<div class="col-xs-7">
<select id="addnewcolor" name="attributes[color]">
<option value="AL" style="background:green;">Green</option>
...
<option value="WY" style="background:red;">Red</option>
</select>
</div>
</div></div>