'optgroup' Example : optgroup « HTML Tag Reference « HTML CSS Reference






'optgroup' Example

    
<html>
<head>
<title>option element example</title>
</head>
<body>
    <form name="form1" method="post" action="youractionscript.asp">
    <p>
        <span class="example">
            <select name="select1">
                <optgroup label="First Group">
                    <option>First item in first group</option>
                    <option>Second item in first group </option>
                    <option>Third item in first group </option>
                </optgroup>
                <optgroup label="Second Group">
                    <option>First item in second group </option>
                    <option>Second item in second group </option>
                    <option>Third item in second group </option>
                </optgroup>
                <optgroup label="Group 3">
                    <option>First item in Group 3</option>
                    <option>Second item in Group 3</option>
                    <option>Third item in Group 3</option>
                </optgroup>
            </select>
        </span>
    </p>
    </form>
</body>
</html>
    
      
      








Related examples in the same category

1.'optgroup' Syntax and Note
2.'optgroup' HTML Attributes
3.'optgroup' Event Handlers
4.'optgroup' JavaScript Properties
5.'optgroup' JavaScript Methods
6.'optgroup' JavaScript Collections