You are here: Reference > HTML > attributes > value (option)

value attribute (option)

Browser support:
Specifies the value of an option element.
The value of a selected option element will be sent when the form is submitted. See the page for the select element to get detailed information about the submitted data that belong to the option tags.
JavaScript page for this attribute: value. You can find other example(s) there.

Possible values:

String that sets the value of the element.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the value attribute:
<select name="Fruit" size="3">
    <option value="Apple" />Apple
    <option value="Pear" />Pear
    <option value="Peach" selected="selected" />Peach
</select>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content