Java Script Foundation (ix) drop-down list object
Select drop-down list
Property:
Options[]: Returns an array that contains all the options in the drop-down list.
SelectedIndex: Sets the index number of the selected item in the Return drop-down list.
Length: Returns the number of options in the drop-down list box. If set to 0, clears the list box.
Method:
Add (New,old): Adds an option. If old is empty, it is added to the end, and old has a value before it is added to old.
Event:
OnChange: The event that is called when the option is changed.
Option Object
Property:
Text: Sets or returns the literal value of an option.
Value: Sets the value of an option.
Example: Adding a week to the select list
<SelectId= "Week"></Select><ScriptType= "Text/javascript">VarSelect=document.getElementById ("Week");VarWeeks=NewArray ("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday", Sunday "); forvar I=0;i<weeks.length;i++ new+1) ); }</script>
Java Script Foundation (ix) drop-down list object