Open mustafavanli opened 1 month ago
You can add option groups like so:
<select id="example" class="form-select">
<optgroup label="Fruit">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="grape">Grape</option>
<option value="kiwi">Kiwi</option>
<option value="orange">Orange</option>
<option disabled value="snake_fruit">Snake fruit</option>
</optgroup>
<optgroup label="Vegetable">
<option value="broccoli">Broccoli</option>
<option value="carrot">Carrot</option>
<option value="cucumber">Cucumber</option>
<option disabled value="eggplant">Eggplant</option>
<option value="spinach">Spinach</option>
<option value="tomato">Tomato</option>
</optgroup>
</select>
At first, the select element will be empty.
What do you mean? When pasting the above code in an html page, this is the result:
What else do you expect?
I fill out my select option only according to the response from axios. How do I group and add data from response?
Is it possible to give a method that will trigger while creating? AND How I adding options to optgroup?