<optgroup> HTML Tag

In this article we will discuss about how to use optgroup tag in HTML.
  • 1576

The <optgroup> Tag comes under <select> tag and this tag allow you  for grouping related options within your select list.

HTML Code:

<html>

<head>

    <title>This is my first web page</title>

</head>

<body>

    <select>

        <optgroup label="Mobile">

            <option value="sydney">Sumsung Galaxy</option>

            <option value="melbourne">Nokia Lumia</option>

        </optgroup>

        <optgroup label="Telivision">

            <option value="L.G.">L.G.</option>

            <option value="Samsung">Samsung</option>

        </optgroup>

    </select>

</body>

</html>

Output:

 drop11.jpg

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
Programming Answers here
© 2019 DotNetHeaven. All rights reserved.