VOOZH about

URL: https://www.geeksforgeeks.org/html/how-to-specify-that-an-option-group-should-be-disabled-in-html5/

⇱ How to specify that an option-group should be disabled in HTML5 ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to specify that an option-group should be disabled in HTML5 ?

Last Updated : 5 Aug, 2025

We will use <optgroup> and <option> tags to create an option-group list and use the disabled attribute with <optgroup> to create a disabled option-group list. The <optgroup> tag is used to create a group of the same category options in a drop-down list. The <optgroup> tag is required when there is a long list of items that exist. The <option> tag in HTML is used to choose an option from a drop-down menu. 

Syntax:

<optgroup label="">
 <option label=""> </option>
</optgroup>

Example: In this example, we are using the above-explained method.

Output:

👁 Image

Comment
Article Tags: