title: individual background colour of options in <select> based on map
body: <p>I would like to set an individual background colour of each option of a <code>&lt;select&gt;</code> with Javascript. The option text and colour (hex) are stored in a <code>Map</code>:</p>
  <p><a href="https://jsfiddle.net/erik_stengel/adqv8zgh/#&amp;togetherjs=qD3ltFg0hx" rel="nofollow noreferrer">JSFiddle</a></p>
  <pre><code>const map = new Map();
  map.set(&quot;005&quot;, &quot;#886da8&quot;);
  map.set(&quot;0075&quot;, &quot;#ffc3cf&quot;);
  
  for (const [key, value] of map.entries()) {
    console.log(key, value);
    $('#cmbExample').append($('&lt;option&gt;', { 
          value: key,
          text : key 
      }));
  }
  </code></pre>
  <p>Finally it should look like this:</p>
  <p><a href="https://i.stack.imgur.com/MFgkA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MFgkA.png" alt="enter image description here" /></a></p>