Currently working on an HTML page that requires a dropdown menu to select between two different colorbars for a graph.
The dropdown options should display the colormaps visually, so I am looking to include either:
- An image of the colorbar
- A gradient background color
- Something else with the same color as the colorbar
Below is the code snippet:
<div class="row g-3">
<div class="col">
<span class="input-group-text"></span>
</div>
<div class="col">
<select class="form-control" id="myDropdown">
<option value="1">Colorbar1</option>
<option value="2">Colorbar2</option>
</select>
</div>
</div>
https://jsfiddle.net/pmtaezgo/
Attempts have been made to specify the background in the CSS, but it doesn't seem to work. Is there a way to represent the colorbars within the dropdown options using HTML or JavaScript?