HTML:- opt group.

<!DOCTYPE html>
<html>

<head>
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <title>optgroup</title>
</head>

<body>

 <select>
 
    <optgroup label="Group 1">
      <option>Option 1.1</option>
    </optgroup>

    <optgroup label="Group 2">
      <option>Option 2.1</option>
      <option>Option 2.2</option>
    </optgroup>

    <optgroup label="Group 3" disabled>
      <option>Option 3.1</option>
      <option>Option 3.2</option>
      <option>Option 3.3</option>
    </optgroup>

</select>

</body>

</html>



Used of:-


Grouping Items in Dropdownlist


  • This creates nested list within a drop-down list, such a way that there can a list within a list.
  • <optgroup> tag may not be nested.


HTML:- opt group. HTML:-  opt group. Reviewed by Network security on May 02, 2019 Rating: 5

No comments:

Useful Information

Powered by Blogger.