HTML input value Attribute
HTML <input> tag
Definition and Usage
The value attribute is used differently for different input types.
For type "text", "password" and "hidden": Specifies the initial (default)
value of the input field.
For type "button", "submit" and "reset": Specifies the text displayed on the
button.
For type "checkbox", "radio" and "image": Specifies the value
associated with
the input. This is the value sent to the form's action URL.
Note: Cannot be used with type="file"
Note: This attribute is required with type="checkbox" and
type="radio"
Syntax
<input value="input_value" />
|
Syntax Example
Attribute Values
Value |
Description |
input_value |
Specifies value of the input element. |
Browser Support

The attribute is supported in all major browsers.
Example
<form action="">
<input type="text" name="demo" value="Peter" />
</form>
|
Try-It-Yourself Demos
input value
attribute example
How use the value attribute with different input types.
HTML <input> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|