Retrieves a collection of the OPTION elements in a SELECT object.
object.options(index)
Parameter Description object A SELECT element. (index) Optional. An integer or a string specifying the index value of the element to retrieve. Integer indexes are zero-based, meaning the first element in the collection has index 0. A string index is valid only if the string is an identifier of at least one element in the document.
To delete an option from a SELECT object, you assign the option a null value. This compresses the array.
If duplicate identifiers are found, a collection of those items is returned. Collections of duplicates must subsequently be referenced by ordinal position.
The following example displays the text and values of all OPTION elements in the first SELECT element in the document.
var coll = document.all.tags("SELECT"); if (coll.length>0) { for (i=0; i< coll(0).options.length; i++) alert("Element " + i + " is " + coll(0).options(i).text + " and has the value " + coll(0).options(i).value); }