I have a HTML select, and using the Chosen JS plugin, for multiple select.
Chosen uses the CSS property background-image and others to set the style for each select option (always the same style). Buy I would like to set each option with its own color when selected.
Is there any option in chosen for that instead of using an own javascript code? I can't see any information about this at the doc.
This is an example I tried (just to try) but it didn't work (of course lool):
<select name="prueba" multiple class="form-control chosen-select">
<option style="background-image: linear-gradient(to bottom, #CCC 0%, #CCC 0%);">option1</option>
<option style="background-image: linear-gradient(to bottom, #000 0%, #000 0%);">option2</option>
</select>
The color is not about the position, it is based in a property of the model and it will be assigned dynamically