Name

defaultSelected — NN 2 IE 3 DOM 1

Synopsis

Read/Write

Whether element has the SELECTED attribute set in the tag. You can compare the current selected property against defaultSelected to see whether the state of the select control has changed since the document loaded. Changing this property does not affect the current selected status.

Example

var listItem = document.forms[0].selector.options[2]
if (listItem.selected != listItem.defaultSelected) {
    process for changed state
}

Value

Boolean value: true | false.

Default

Determined by HTML tag attribute.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.