value

The value attribute sets the current or default value of a form control or list item.

Since HTML 2.0 Spec ↗

Syntax

value="data"

Examples

<input type="text" name="city" value="Berlin">
<option value="us">United States</option>
<li value="5">Item</li>
Output
Pre-fills the text field with "Berlin", submits "us" for the option, and numbers the list item as 5.

Notes

For text inputs it is the initial value, not the live value (read element.value in JS). For <option> it is the submitted data; for <li> in <ol> it sets the ordinal.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also