English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML tag list

HTML option value attribute

The value attribute specifies the value to be sent to the server when the form is submitted. Start with <option> and end with </option>./ Content between the <option> tags is the content that the browser will display in the dropdown list.

 HTML <option> tag

Online Example

HTML form dropdown list:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<option value=" - 基础教程网(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php">
<select name="language">
  <option value="PHP" disabled>PHP</option>
  <option value="HTML">HTML</option>
  <option value="C++">C++</option>
  <option value="GOLANG">GOLANG</option>
  <option value="JAVA">JAVA</option>
</select>
<input type="submit" value="Submit">
</form>
</body>
</html>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All major browsers support the value attribute.

Definition and usage

The value attribute specifies the value to be sent to the server when the form is submitted.

Start with <option> and end with <// The content between the <option> and </option> tags is the content that the browser will display in the dropdown list. However, the value of the value attribute is the value that will be sent to the server when the form is submitted.

Note: If the value attribute is not specified, the content is passed as the value.

HTML 4.01 with HTML5differences

None.

Syntax

<option value="value">

Attribute value

ValueDescription
valueValue sent to the server.
 HTML <option> tag