Select.options

JavaScript1.0+, JScript1.0+ Nav2+, IE3+, Opera3+ Syntax

							select.options

Description

The options property of the Select object is an array that contains the elements of each of the options in the select box. This property is often used to retrieve properties of the options in a select box, such as the value or text.

Example

Listing 7.473 has a select box with four options in it. When an option is selected, a second window pops up. In this window, the document.write() method is used to write the properties of the selected option to the page.

Listing 7.473 Example of Using the option Array to Retrieve the Properties of a Selected Option in a Select Box
 <html> <head> <script language="JavaScript"> <!-- Hide // Pop up an alert ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.