HTML <option> value Attribute

❮ HTML <option> tag

Example

<form action="action.php">
<label for="lang">Choose a language:</label>

<select id="lang" name="lang">
  <option value="HTML">HTML</option>
  <option value="CSS">CSS</option>
  <option value="JavaScript">JavaScript</option>
</select>

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

Meaning

The value attribute specifies the value to be included with the form result when the item is selected.

The value sent when the form is submitted if the option has been selected in the dropdown list.

Note: If the value attribute is omitted, the content will be passed as a value instead.


Standard Syntax

<option value="text">text</option>



Browser Support




Status







Attribute Values

Value Description
text Specifies the textContent of the element.
❮ HTML <option> tag