Sets or retrieves the default or selected value of the control.
dhtml语法
HTML | <ELEMENT VALUE
= sValue... >
|
---|
Scripting | object.value [ = sValue ] |
---|
DHTML可能的值
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. |
是否符合公共标准
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
更多语法参考
button, input