The length
property of the HTMLOptionsCollection interface returns the number of option elements in the collection.
The selectedIndex
property of the HTMLOptionsCollection interface is the numeric index of the first selected option element, if any, or −1
if no <option>
is selected.
The add()
method of the HTMLOptionsCollection interface adds an HTMLOptionElement or HTMLOptGroupElement to this HTMLOptionsCollection
.
Optional
before: null | number | HTMLElementThe HTMLCollection method item()
returns the element located at the specified offset into the collection.
The remove()
method of the HTMLOptionsCollection interface removes the option element specified by the index from this collection.
The
HTMLOptionsCollection
interface represents a collection of<option>
HTML elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items.MDN Reference