HTML Input value Attribute

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"


<input value="input_value" />

Syntax Example

<input value="Harry" />

Attribute Values

Value Description
input_value Specifies value of the input element.

Browser Support

The attribute is supported in all major browsers.


<form action="">
<input type="text" name="demo" value="Harry" />
HTML Input value Attribute Reviewed by 1000sourcecodes on 03:50 Rating: 5
Powered by Blogger.