Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

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

  • Last Updated : 24 Mar, 2021

We will use <optgroup> and <option> tags to create an option-group list and use 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 the item exists. The <option> tag in HTML is used to choose an option from a drop-down menu. 


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

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



<!DOCTYPE html>
        How to specify that an option-group
        should be disabled in HTML5?
<body style="text-align: center;">
    <h1 style="color: green;">
        How to specify that an option-group<br>
        should be disabled in HTML5?
        <optgroup label="Computer Programming" disabled>
            <option value="c">C</option>
            <option value="cpp">C++</option>
            <option value="java">Java</option>
            <option value="python">Python</option>
        <optgroup label="Web Technology">
            <option value="html">HTML</option>
            <option value="css">CSS</option>
            <option value="js">JavaScript</option>
            <option value="jquery">jQuery</option>


My Personal Notes arrow_drop_up
Recommended Articles
Page :