HTML <option> value attribute
Definition and Usage
value
The attribute specifies the value to be sent to the server when submitting the form.
The content between the <option> and </option> tags is the content that the browser will display in the drop-down list. However,value
The value of the attribute is the value that will be sent to the server when the form is submitted.
Attention:If not specified value
If the attribute is not specified, the content itself will be passed as the value.
Example
HTML form dropdown list:
<form action="/action_page.php"> <label for="cars">Please select a car brand:</label> <select id="cars" name="cars"> <option value="audi">Audi</option> <option value="byd">BYD</option> <option value="geely">Geely</option> <option value="volvo">Volvo</option> </select> <input type="submit" value="Submit"> </form>
Syntax
<option value="value">
Attribute Value
Value | Description |
---|---|
value | The value to be sent to the server. |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |