Class HTMLOptionsCollection
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
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. This object is returned only by the options property of select.
[Value("HTMLOptionsCollection")]
public class HTMLOptionsCollection : HTMLCollection
- Inheritance
-
HTMLOptionsCollection
- Inherited Members
Remarks
Constructors
HTMLOptionsCollection()
public HTMLOptionsCollection()
Properties
Length
The length property of the HTMLOptionsCollection interface returns the number of {{htmlelement("option")}} elements in the collection. The property can get or set the size of the collection.
[Value("length")]
public ulong Length { get; set; }
Property Value
- ulong
An integer value representing the number of items in this
HTMLOptionsCollection.
Remarks
When setting length to a value smaller than the current, the options collection gets truncated; otherwise, new blank <option> elements are appended to the end of the <select>.
-Add(Union54, Union55?)
-Remove(long)
-SelectedIndex
-HTMLSelectElement
-HTMLOptGroupElement
-Length
SelectedIndex
The selectedIndex property of the HTMLOptionsCollection interface is the numeric index of the first selected {{HTMLElement("option")}} element, if any, or −1 if no <option> is selected. Setting this property selects the option at that index and deselects all other options in this collection, while setting it to -1 deselects any currently selected elements. It is exactly equivalent to the SelectedIndex property of the HTMLSelectElement that owns this collection.
[Value("selectedIndex")]
public long SelectedIndex { get; set; }
Property Value
- long
A number.
Remarks
-Length
-Add(Union54, Union55?)
-Remove(long)
-HTMLOptionsCollection
-HTMLOptionElement
-HTMLOptGroupElement
-HTMLSelectElement
Methods
Add(Union54, Union55?)
The add() method of the HTMLOptionsCollection interface adds an HTMLOptionElement or HTMLOptGroupElement to this HTMLOptionsCollection.
[Value("add")]
public GlobalObject.Undefined Add(Union54 element, Union55? before = null)
Parameters
Returns
Remarks
Remove(long)
The remove() method of the HTMLOptionsCollection interface removes the {{HTMLelement("option")}} element specified by the index from this collection.
[Value("remove")]
public GlobalObject.Undefined Remove(long index)
Parameters
indexlong
Returns
Remarks
-Add(Union54, Union55?)
-Length
-SelectedIndex
-HTMLOptionsCollection
-Element.Remove