Sets or retrieves the default or selected value of the control.
Syntax
HTML | <ELEMENT VALUE
= sValue... >
|
---|
Scripting | object.value [ = sValue ] |
---|
Possible Values
sValue | String 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:
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=checkbox | The selected value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value. |
input type=file | The value, a file name, typed by the user into the control. Unlike other controls, this value is read-only. |
input type=hidden | The value that the control submits when the form is submitted. |
option | The selected value. The containing list box control submits this value only if the user has selected the option. |
input type=password | The default value. The control displays this value when it is first created and when the user clicks the reset button. |
input type=radio | The selected value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value. |
input type=reset | The button label. If not set, the label defaults to Reset. |
input type=submit | The button label. If not set, the label defaults to Submit. |
input type=text | The 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 and
is defined in
World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To
See Also
button, input