VALUE Attribute | value Property

Internet Development Index

Sets or retrieves the default or selected value of the control.

Syntax

HTML<ELEMENT VALUE = sValue... >
Scriptingobject.value [ = sValue ]

Possible Values

sValueString that specifies or receives the value for the control.

The property is read/write. The property has no default value for all objects with the following exceptions:
INPUT type=checkboxon
INPUT type=resetReset
INPUT type=submitSubmit Query

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

The purpose of the value property depends on the type of control as described in the following table.
input type=checkboxThe selected value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value.
input type=fileThe value, a file name, typed by the user into the control. Unlike other controls, this value is read-only.
input type=hiddenThe value that the control submits when the form is submitted.
optionThe selected value. The containing list box control submits this value only if the user has selected the option.
input type=passwordThe default value. The control displays this value when it is first created and when the user clicks the reset button.
input type=radioThe selected value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value.
input type=resetThe button label. If not set, the label defaults to Reset.
input type=submitThe button label. If not set, the label defaults to Submit.
input type=textThe default value. The control displays this value when it is first created and when the user clicks the reset button.

Standards Information

This property is defined in HTML 4.0 Non-Microsoft link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

BUTTON, INPUT, INPUT type=checkbox, INPUT type=hidden, INPUT type=button, INPUT type=radio, INPUT type=reset, INPUT type=submit

See Also

button, input