You are here: Reference > HTML > attributes > value (input, isindex)

value attribute (input, isindex)

Browser support:
Specifies the initial value for a control element.
For the input:checkbox and the input:radio elements, the contents of the value attribute do not appear in the user interface. For these two elements the value attribute only has meaning when submitting a form. See the page for the input:checkbox and the input:radio elements for details.
JavaScript page for this attribute: value. You can find other example(s) there.

Possible values:

String that sets the value of the control.
Element Default value
input:checkbox and input:radio 'on'
input:reset 'reset'
input:submit 'submit'
other elements an empty string

Example HTML code 1:

This example illustrates the use of the value attribute:
<input type="text" value="Sample text" size="30" />
<br />
<input type="button" value="Sample button" />
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content