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 |
Click here to design a Stunning Flash Website for Free
Wix is a revolutionary web design tool that provides anyone with the possibility to create professional and beautiful websites for free.
With e-commerce features, search engine visibility and many more professional tools, Wix is the ultimate solution for creating a spectacular site while saving tons of money.
|