I do with select in two ways:
<select name="curso1" id="curso1">
<option disabled="" style="font-size:12px; text-align:left; font-family:Arial Black">Group</option>
<option value="1">Windows 8</option>
<option value="8">lalalala</option>
</select>
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
How to do this in a datalist?
How do group with the datalist?
This looks neat on Chrome, but I don't know how it will render in other browsers.
<label>Choose a browser from this list:
<input list="browsers" name="myBrowser" /></label>
<datalist id="browsers">
<option value="Brave">GroupA</option>
<option value="Firefox"></option>
<option value="Safari"></option>
<option value="Opera">GroupB</option>
<option value="Internet Explorer"></option>
<option value="Microsoft Edge"></option>
</datalist>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With