option value Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:option

Description

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

Attribute Values

Value Description
value The value to be sent to the server

The following code shows how to create A drop-down list inside an HTML form:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
<select name="cars">
  <option value="v">V</option>
  <option value="s">S</option>
  <option value="m">M</option>
  <option value="a">A</option>
</select><!--  www.j a v  a2s  .c  o m-->
<input type="submit" value="Submit">
</form>


</body>
</html>

Related Tutorials