Java Script Foundation (ix) drop-down list object

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.