Click to return to the DHTML, HTML     
sectionRowIndex Property     selectedIndex Property     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

SELECTED Attribute | selected Property


Sets or retrieves whether the option in the list box is the default item.

Syntax

HTML<OPTION SELECTED ... >
Scriptingselect.options[iIndex].selected [ = bSelected ]

Possible Values

bSelected Boolean that specifies one of the following values:
falseItem is not selected as the default.
trueItem is selected as the default.

The property is read/write with a default value of false.

Remarks

If the property is not set, the first item is selected by default.

The property determines whether a value is submitted with the form. If the value of the control matches the default value, the control's value is not submitted. The value is submitted only when the control's value does not match the default value.

To select an item in HTML, it is not necessary to set the value of the SELECTED attribute to true. The mere presence of the SELECTED attribute set its value to true.

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:

OPTION

See Also

defaultSelected



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.