Option ObjectNameOption Object---an option in a Select boxAvailabilityNavigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0 Synopsis
select.options[i] Properties
Constructor
new Option([text, [value, [defaultSelected, [selected]]]]) Arguments
ReturnsThe newly created Option object. HTML SyntaxAn Option object is created by an <OPTION> tag within a <SELECT> which is itself within a <FORM>. Multiple <OPTION> tags typically appear within the <SELECT>.
<FORM ...> <SELECT ...> <OPTION [ VALUE="value" ] the value returned when the form is submitted [ SELECTED ] > specifies whether this option is initially selected plain_text_label the text to display for this option ... </SELECT> ... </FORM> DescriptionThe Option object describes a single option displayed within a Select object. The properties of this object specify whether it is selected by default, whether is is currently selected, what position it has in the options[] array of its containing Select object, what text it displays, and what value it passes to the server if it is selected when the containing form is submitted. Note that although the text displayed by this option is specified outside of the <OPTION> tag, that text must be plain, unformatted text, without any HTML tags. This is so that the text can be properly displayed in list boxes and drop-down menus that do not support HTML formatting. You can dynamically create new Option objects for display in a Select object with the Option() constructor. Once a new Option object is created, it can be appended to the list of options in a Select object by assigning it to the variable options[options.length]. See Select.options[] for details. |
|