Using <optgroup> in Dropdown Lists

In this lesson, we'll learn how to make use of the <optgroup> tag in our form.

The <select> tag allows you to use the <optgroup> tag to create groups of options. An example is shown in the image that follows the upcoming exercise. In order to create these groups, surround the specific options with <optgroup>.

Exercise-04-07 demonstrates this concept:

Get hands-on with 1200+ tech skills courses.