ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: DOM Option ¶ÔÏó

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

HTML DOM
DOM Input Checkb..
DOM Input File ¶..
DOM Input Hidden..
DOM Input Passwo..
DOM Input Radio ..
DOM Input Reset ..
DOM Input Submit..
DOM Input Text ¶..
DOM Link ¶ÔÏó
DOM Location ¶ÔÏ..
DOM Meta ¶ÔÏó
DOM Navigator ¶Ô..
DOM ¶ÔÏó
DOM Option ¶ÔÏó
DOM Screen ¶ÔÏó
DOM Select ¶ÔÏó
DOM Style ¶ÔÏó
DOM Table ¶ÔÏó
DOM TableData ¶Ô..
DOM TableHeader ..

DOM Option ¶ÔÏó


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:5630 :: ::

Option ¶ÔÏó

The Option object represents a selectable option in a drop-down list in an HTML form. For each instance of an <option> tag in an HTML form, an Option object is created.
Option¶ÔÏó´ú±íHTML±íµ¥ÖеĿÉÑ¡Ïî¡£HTML±íµ¥ÖÐÖ»Òª³öÏÖ<option>±êÇ©¾ÍÓÐOption¶ÔÏó±»½¨Á¢

You can access an Option object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
Äã¿ÉÒÔ´Ó±íµ¥Êý×éµÄÊý×Ö»òÊÇÃû³ÆÀ´·ÃÎÊOption¶ÔÏ󣬻òÊÇʹÓÃgetELmentById()À´·ÃÎÊËü

IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

Option ¶ÔÏóÊôÐÔ

Property
ÊôÐÔ
Description
ÃèÊö
IE F N W3C
defaultSelected Sets or returns the value of the selected attribute of the option
ÉèÖûòÊÇ·µ»ØOptionselectedÊôÐÔµÄÖµ
3 1 6 Yes
disabled Sets or returns a Boolean value that specifies whether the option should be disabled
ÉèÖûò·µ»ØÒ»¸ö²¼¶úÖµÅжÏOptionÊÇ·ñ½ûÓÃ
5 1 6 Yes
form Returns a reference to the form that contains the option
·µ»Ø°üº¬Option±íµ¥µÄ²Î¿¼
3 1 6 Yes
id Sets or returns the id of the option (In IE 4 this property is read-only)
ÉèÖûò·µ»ØOptionµÄid(ÔÚIE4ÖÐÕâ¸öÊôÐÔΪֻ¶Á)
4 1   No
index Sets or returns the position of the option in the select box
ÉèÖûò·µ»ØOptionÔÚselect¿òÖеÄλÖÃ
3     Yes
label Sets or returns a label for the option object
ÉèÖûò·µ»ØOption¶ÔÏóµÄlabel
6     Yes
selected Sets or returns the current state of the option
ÉèÖûò·µ»ØOptionµÄµ±Ç°×´Ì¬£¨ÊÇ·ñΪѡÖУ©
3 1 6 Yes
text Sets or returns the text value for the <option> tag
ÉèÖûò·µ»ØOption±êÇ©µÄÎÄ×ÖÖµ
3 1 6 Yes
value Sets or returns the value to be returned to the server when an option is selected and the form is submitted
ÉèÖûò·µ»Øµ±±»Ñ¡ÖеÄOptionÌá½»µ½·þÎñÆ÷ʱËüËù°üº¬µÄÖµ
3 1 6 Yes

Option ¶ÔÏó·½·¨

Method
·½·¨
Description
ÃèÊö
IE F N W3C
click() Simulates a mouse-click on the option
Ä£·ÂÊó±êµã»÷Option
4     No

ÆÀÂÛ (0) All