text property (optgroup, option)
Sets or returns a string that represents the text of an option element.
If the value property is not specified for a selected option element, then the text content will be sent to the server when the container form is submitted.
You can find the related objects in the Supported by objects section below.
This property is read/write.
String that sets or retrieves the text of the object.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the text property:
Did you find this example helpful?
User Contributed Comments