value
The value attribute sets the current or default value of a form control or list item.
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
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |