<optgroup> HTML Tag
In this article we will discuss about how to use optgroup tag in HTML.
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:

Ask Your Question