The <listoption> Tag

Purpose

The <listoption> tag renders a select option (i.e., it is mapped to an HTML <option> element). The option's label is obtained from the list model, which has been attached to the enclosing <select> tag.

Requirements

A <listoption> tag has to be embedded in a <select> tag with an attached list model.

Attributes

Attribute groups: %coreattrs, %i18n and %events.

NameDescription
disabled Mapped to the HTML attribute of the same name.
value Mapped to the HTML attribute of the same name. If set, its value has to be a valid key in the list model attached to the enclosing <select> tag. If no value attribute is specified, the option is rendered as a "default option": the value attribute of the rendered HTML <option> element will be set to the empty string and the label will be taken from the tag body. The HTML option will be selected if the selection of the <select> tag's group model is empty.

Body

If the value attribute is set, the option's label is taken from the group list model and the body is ignored. Otherwise, if the tag is to be rendered as a default option, the body is taken as the label for the entry in the selection list.

Related tags

<select>, <listoptions>, <option>