Option text Property
Option Object
Definition and Usage
The text property sets or returns the text value of the option.
Tip: This property sets or returns the plain text contained in
Syntax
Set the text property:
optionObject.text=
"text"
Return the text property:
optionObject.text
Browser support





All major browsers support the text property
Example
Example
The following example returns the text of all options in the dropdown list:
Try it »
More examples
Output the text of all options in the dropdown list
Option Object