JSFiddle - React, Tailwind, and code Playground
by Satpal Singh
HTML
<div id="LOBSelect" class="clearfix displayOnCreate"> <span class="label">Dropdown</span>
<select name="lob-select" class="dk" id="lobSelect"></select>
</div>
JavaScript
var returnLOB = [{
id: 1,
name: "CIB"
}, {
id: 2,
name: "GTI"
}
]
for (var j = 0; j < returnLOB.length; j++) {
$('#LOBSelect').find('select[name="lob-select"]').append($('<option/>', {
value: returnLOB[j].name,
text: returnLOB[j].name,
id: returnLOB[j].id
}));
}