The HTML Elements reference.

"optgroup" - html element

  • This element defines a group of choices within a SELECT menu.
  • Starttag <optgroup> is Required and endtag </optgroup> is Required
  • The element must contain one or more 'option' elements to define the actual choices.
  • Browsers that support the optgroup - element : Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari
Element "optgroup" example:
<html>
  <body>
    <form method="post" action="#">
      <p>
        <label for="position">Position in the Company?</label><br />
        <select name="city" id="question">
          <optgroup label="Administration">
            <option value="1">Director (CEO)</option>
            <option value="2">Finance Manager</option>
            <option value="3">Communications Manager</option>
            <option value="4">HR Manage</option>
            <option value="5">Contract Manager </option>
          </optgroup>
          <optgroup label="Project">
            <option value="6">Graphic Designer</option>
            <option value="7">Team Leader</option>
            <option value="8">IT Developers</option>
            <option value="9">Technical Architects</option>
          </optgroup>
        </select>
      </p>
    </form>
  </body>
</html>


Attributes:
class , dir , disabled , id , label (required), lang , style , title

Attribute "class" value(s): A list of style class names that must be separated by white space characters.
  • This attribute assigns a style class name or set of style class names to an element. Any number of elements may be assigned the same class name or names.
  • You will find more about this in the CSS learning on this site.



© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.