HTML DOM Option Object
Option Object
The Option object represents an option in a dropdown list in an HTML form.
For each instance of an <option> tag in an HTML form, an Option object is created.
You can access an Option object by searching through the elements[] array of the form, or by using document.getElementById().
IE: Internet Explorer, F: Firefox, O: Opera, W3C: W3C Standard.
Option Object Properties
| Property |
Description |
IE |
F |
O |
W3C |
| defaultSelected |
Returns the default value of the selected attribute |
4 |
1 |
9 |
Yes |
| disabled |
Sets or returns whether or not an
option should be disabled |
4 |
1 |
9 |
Yes |
| form |
Returns a reference to the form that contains an option |
4 |
1 |
9 |
Yes |
| id |
Sets or returns the id of an option |
4 |
1 |
9 |
Yes |
| index |
Returns the index position of an option in a dropdown list |
4 |
1 |
9 |
Yes |
| label |
Sets or returns a label for an option (only for
option-groups) |
6 |
|
|
Yes |
| selected |
Sets or returns the value of the selected attribute |
4 |
1 |
9 |
Yes |
| text |
Sets or returns the text value of an option |
4 |
1 |
9 |
Yes |
| value |
Sets or returns the value to be sent to the
server |
4 |
1 |
9 |
Yes |
Standard Properties
| Property |
Description |
IE |
F |
O |
W3C |
| className |
Sets or returns the class attribute of an element |
5 |
1 |
9 |
Yes |
| dir |
Sets or returns the direction of text |
5 |
1 |
9 |
Yes |
| lang |
Sets or returns the language code for an element |
5 |
1 |
9 |
Yes |
| title |
Sets or returns an element's advisory title |
5 |
1 |
9 |
Yes |

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file, Excel 2007, XBRL, or Web services data.
Then it transforms data instantly or auto-generates royalty-free data integration code for recurrent conversions.
New features in Version 2010!
Download a free, fully functional 30-day trial to experience the following features:
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
Download a fully-functional trial today!
|
|
|
|