Next / Previous / Contents / TCC Help System / NM Tech homepage

14.5. The option element: One choice inside a select control

Each option element inside a select control has this content model:

element option
{ attribute selected { 'selected' }?,
  attribute value { 'value' }?,

If you don't specify this attribute on any of the choices in the select control, the first choice will be selected initially. If you want a different choice to be the default initial choice, add a selected='selected' attribute to that choice's option element.


If specified, the value of this attribute will be sent to the handler script for this choice. If you don't specify this attribute, the data sent to the handler will be the text content of the element.

For example, this choice would display as “Queen Elizabeth II”, but if selected, the string “QE2” would be sent to the handler:

  <option value="QE2">Queen Elizabeth II</option>


You can use any of the attributes from Section 15.3, “The common attributes: Common.attrib.


Place the text you want to display for this choice inside the element's tags.