# \<option>

## \<option> <a href="#option" id="option"></a>

An option list is represented by a set of `<option>` elements contained in a `<field>` element. Each `<option>` element contains PCDATA that is used to generate a speech grammar.

### Attributes

<table><thead><tr><th width="178.33333333333331">Name</th><th width="150">Data type<select><option value="a0885717206a4f4686ffd005ec636499" label="String" color="blue"></option><option value="5eaddbcfe2744659817e91f0f1bda03a" label="Integer" color="blue"></option><option value="b970ad8ae6de48668eeaff50dd02922a" label="Boolean" color="blue"></option></select></th><th>Description</th></tr></thead><tbody><tr><td>dtmf</td><td><span data-option="5eaddbcfe2744659817e91f0f1bda03a">Integer</span></td><td>The DTMF sequence for this option. It is equivalent to a simple DTMF <code>&#x3C;grammar></code>, and DTMF properties apply to recognition of the sequence.</td></tr><tr><td>value</td><td><span data-option="a0885717206a4f4686ffd005ec636499">String</span></td><td><p>The string to assign to the field's form item variable when a user selects this option, whether by speech or DTMF.</p><p></p><p>The default assignment is the CDATA content of the &#x3C;option> element, with leading and trailing white space removed. If this does not exist, then the DTMF sequence is used instead.</p></td></tr><tr><td>accept</td><td><span data-option="a0885717206a4f4686ffd005ec636499">String</span></td><td><p>(defaults to “exact”) Accepted values include "exact" and "approximate".</p><p></p><p>When set to “exact”, the <code>option</code> element's value defines the exact phrase to be recognized.</p><p></p><p>When set to “approximate”, the <code>option</code> element's value defines an approximate recognition phrase.</p></td></tr></tbody></table>

### Notes

None

### Example

```markup
<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <field name="maincourse">
      <prompt>
        Please select an entree.
      <enumerate>
        For <value expr="_prompt"/>, press <value expr="_dtmf"/> or say <value expr="_prompt"/>.
      </enumerate>
      </prompt>
      <option value="fish" dtmf="1"> swordfish steak </option>
      <option value="beef" dtmf="2"> roast beef </option>
      <option value="chicken" dtmf="3"> frog legs </option>
      <filled>
        You chose <value expr="maincourse"/>.
      </filled>
    </field>
  </form>
</vxml>
```

The output of the above script would be:

> Computer: Please select an entree. For swordfish steak, press 1 or say swordfish steak. For roast beef, press 2 or say roast beef. For frog legs, press 3 or say frog legs.\
> Human: \<user enters: 1>\
> Computer: You chose fish.

### Child Tags

None

### Parent Tags

[\<field>](https://docs.plumvoice.com/dev/voicexml/tags/field-tag)
