Sometimes it is useful to group the options of an HTML select element. Many developers use extra option elements and non-breaking spaces to create the visual appearance of hierarchical options, but there is another way: the often forgotten optgroup element. To create a group of options, wrap them in an optgroup element. To give the group a label, use the label attribute. Here is a simple example: Read More

