The "optgroup" tag in HTML5

Here, we will learn the use of "optgroup" tag in HTML5.

Introduction: The <optgroup> tag is used for group of options. Generally <optgroup> tag is used with drop-down box. Now, we use this tag in our application. Write the following code

<optgroup label="Computer Language">
<optgroup label="Database">
<option>SQL SERVER</option>

Now, we run this code. The output will look like as below

<optgroup> tah in html5

When we Click on drop-down box, the list of options are displayed with group name which is defined with <optgroup> tag. Like as below figure

 <optgroup> tah in html5