I have a select element and I want to add select options from javascript. I have a ajax method and this method returns JSON object like;
"{"serverTypes":["WINDOWS","LINUX"]}"
I want to add options from this JSON. Is there any way to do this?
<select id="serverTypes" name="serverType" class="form-control"></select>
EDIT:
Setting value is not working
$('#serverTypes').val(jsonData);