HTML CSS examples for HTML Tag:optgroup
The label attribute specifies a label for an option-group.
Value | Description |
---|---|
text | Specifies a label/description for the option-group |
The following code shows how to create Two option-groups with labels:
<!DOCTYPE html> <html> <body> <select> <optgroup label="Swedish Cars"> <option value="css">CSS</option> <option value="java">Java</option> </optgroup> <optgroup label="German Cars"> <option value="javascript">Javascript</option> <option value="sql">SQL</option> </optgroup> </select><!-- ww w.j av a 2 s. c o m--> </body> </html>