<option> Tag Syntax

Rules for coding HTML option elements
<body>
   ... flow content expected ...
   <form method="POST" action="form-handler">
      ... flow content ...
      <select>
         ...
         <option value="...">...</option>
         ...
      </select>
      ... flow content ...
   </form>
   ...
</body>
Rules for coding the HTML option element

Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.

  1. Inside a select element, include an option element for each option in the select list.
  2. Begin the option element with a starting <option> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the xmlns attribute on the <html> tag.
  3. Inside the <option> tag, code a value attribute with the value of the field that is to be sent to the destination specified in the <form action> attribute.
  4. Inside the option element, between the starting <option> tag and the ending </option> tag, code the text content of the option.
  5. End the option element with a matching </option> closing tag.
<option> Content Model
Content of the option element

The content of the option element can include HTML comments and text content. It should not have any child elements.