Javascript Reference
Categories: OPTION

javascript OPTION defaultSelected

@March 15, 2008, 1:22 a.m.
defaultSelectedFirefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM 1  

Read/Write  

Determines whether an 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.


Powered by Linode.