Horje

How to Use <select> with <optgroup> label tags

Follow the Example.

index.html
Example: HTML
<label for="cars">Choose a car:</label>
<select name="cars" id="cars">
  <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> 

Output should be:

How to Use <select> with <optgroup> label tags




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin