HTML <optgroup> disabled Attribute

The disabled attribute of the is used to disable an option-group. After that, the option-group becomes unclickable. Following is the syntax ?

Let us now see an example to implement the disabled attribute of the element ?

Example



Water Levels

Impurity Level

Output

In the above example, we have set two option-groups ?


   
   


   
   
   
   

We have set one of the option-group as disabled ?


   
   
   
   

Now the above options will become disabled and visitors won?t be able to select them.

Updated on: 2026-03-11T22:50:44+05:30

192 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements