options collection
返回下拉列表中的collection
所有内容。options
x.options.item(index) //Returns the element from the collection with the specified index
x.options[index] // will returns element from collection with specified collection .index is an integer specifies the element to retrieve (starts at 0)
所以.text
在这两种情况下都会返回相同的
这是收集方法的列表选择选项收集
[index] An integer that specifies the element to retrieve (starts at 0)
[add(element[,index])] Adds an option element into the collection at the specified index. If no index is specified, it inserts the option element at the end of the collection
item(index) Returns the element from the collection with the specified index
namedItem(name) Returns the element from the collection with the specified name (name or id attribute)
remove(index) Removes the element with the specified index from the collection