This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

defaultSelected

Summary

Gets or sets the value of the selected HTML attribute.

Property of dom/HTMLOptionElementdom/HTMLOptionElement

Syntax

var initiallySelected = option.defaultSelected;
option.defaultSelected = value;

Return Value

Returns an object of type BooleanBoolean

Whether the selected HTML attribute is present.

Notes

The property can be changed programmatically, but doing so has no effect on the appearance of the option or the submitted value - if the selected property has been changed by a user or by a script. The property does change the appearance of the selected option if the form is reset.

Related specifications

DOM Level 1
Recommendation

See also

Related pages

Attributions