I would like to set an individual background colour of each option of a <select> with Javascript. The option text and colour (hex) are stored in a Map:
const map = new Map();
map.set("005", "#886da8");
map.set("0075", "#ffc3cf");
for (const [key, value] of map.entries()) {
console.log(key, value);
$('#cmbExample').append($('<option>', {
value: key,
text : key
}));
}
Finally it should look like this:
