How can I make an optgroup in a select tag clickable in html. When we click this label, all its child options should be selected.
Example: Selecting the optgroup with label Swedish Cars should automatically select the Volvo and Saab options.
<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>