Click to Rate and Give Feedback
TechNet
TechNet Library

  Switch on low bandwidth view
SELECTED Attribute | selected Property

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

Syntax

HTML<ELEMENT SELECTED ... >
Scripting[ bSelected = ] object.selected

Possible Values

bSelectedBoolean that specifies or receives one of the following values.
false
Default. Item is not selected as the default.
true
Item is selected as the default.

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

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are not supported in IE8 mode. For more information, see About Dynamic Properties.

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.

Standards Information

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

Applies To

OPTION, HTMLOptionElement Constructor

See Also

defaultSelected
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker