Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input value Attribute

HTML value attribute

HTML input Tag Reference HTML tag

Example

An HTML form with initial (default) values:

First name:

Last name:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value attribute.


Definition and Usage

The value attribute specifies the The value of the element.

The value attribute is used differently for different input types:

  • For "button", "reset", and "submit" types - defines the text on the button
  • For "text", "password", and "hidden" types - defines the initial (default) value of the input field
  • For "checkbox", "radio", and "image" types - defines the value associated with the input element, which is sent to the form's action URL when the form is submitted.

**Note:** The value attribute is required for and is required.

**Note:** The value attribute does not apply to .


Differences between HTML 4.01 and HTML5

none.


Syntax

Attribute values

Value Description
text Specifies the The value of the element.

HTML input Tag Reference HTML tag