value attribute (input, isindex)
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.
Default:
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?
|
Supported by tags:
input:button, input:checkbox, input:hidden, input:password, input:radio, input:range, input:reset, input:search, input:submit, input:text, isIndex
External links:
value (MSDN)
value (TEXTAREA) (MSDN)
value (TEXTAREA) (Mozilla Developer Center)
value (Safari Reference Library)
value (INPUT) (W3C)
value (BUTTON)(W3C)
value (TEXTAREA) (MSDN)
value (TEXTAREA) (Mozilla Developer Center)
value (Safari Reference Library)
value (INPUT) (W3C)
value (BUTTON)(W3C)
User Contributed Comments