JSFiddle - React, Tailwind, and code Playground
by seankoole
HTML
<select name="" id="one"></select>
<select name="" id="two"></select>
JavaScript
jQuery(function($) {
const $select = $('#one');
$.getJSON('https://bangladesh.wpengine.com/wp-json/complaints/v1/statuses', (data) => {
const html = [];
$.each(data, (k, v) => {
html.push('<option>' + v + '</option>')
})
$select.html(html);
})
});
jQuery(function($) {
const $select = $('#two');
const data = {
"Non-OSH": "Non-OSH",
"Not processed": "Not processed",
"Not Sustained": "Not Sustained",
"Resolved": "Resolved",
"Resolved outside Accord complaints mechanism": "Resolved outside Accord complaints mechanism",
"Unresolved": "Unresolved",
"Withdrawn": "Withdrawn"
};
const html = [];
$.each(data, (k, v) => {
html.push('<option>' + v + '</option>')
})
$select.html(html);
});