Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

HTML <option> value Attribute

The value attribute on an <option> tag sets the value of the option.

The value of the selected option is included during form submission.

Example

#

A value attribute on <option> elements.
The selected value is sent during form submission.

Your location
<form action="/tutorial/action.html">
  <fieldset>
    <legend>Your location</legend>

    <select name="country" style="width:220px;">
      <option value="">-- Select a Country --</option>
      <option value="us">United States</option>
      <option value="uk">United Kingdom</option>
      <option value="fr">France</option>
      <option value="de">Germany</option>
    </select><br/>

    <input type="submit" value="Submit">
  </fieldset>
</form>

Using value

The value attribute specifies the value of the <option>.

When a form is submitted, the parent <select> element sends the value of the selected option.

If the <option> has no value attribute, the option's content will be submitted instead.


Syntax

<option value="value">

Values

#

Value Description
value An alphanumeric string.

Browser support

Here is when value support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <option>
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

Guides