VALUE Attribute | value Property

DHTML, HTML, & CSS

VALUE Attribute | value Property


Sets or retrieves the value of the object.

Syntax

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

Possible Values

sValueString that specifies the value of an object or a FORM control. The purpose of the string depends on the type of control, as follows:
checkboxThe selected value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value.
fileThe value, a file name, typed by the user into the control. Unlike other controls, this value is read-only.
hiddenThe control submits this value when the form is submitted.
OPTIONThe selected value. The containing list box control submits this value only if the user has selected the option.
passwordThe default value. The control displays this value when it is first created and when the user clicks the reset button.
radioThe button label. If not set, the label defaults to "Reset".
resetThe selected value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value.
submitThe button label. If not set, the label defaults to "Submit Query."
textThe default value. The control displays this value when it is first created and when the user clicks the reset button.

This property is read/write with a default value of on for the checkbox and radio objects, Submit Query for the submit object, and Reset for the reset object. All other objects have no default value.

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

Remarks

The VALUE attribute of the PARAM object specifies a value passed to an APPLET, EMBED, or OBJECT object.

Example

This example sets the value for each option to an integer string (for example, a part number).

Sample Code

<SELECT>
<OPTION VALUE="123">Item One
<OPTION VALUE="456">Item Two
<OPTION VALUE="789">Item Three
</SELECT>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
BUTTON, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, OPTION, PARAM

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.