HtmlOptionsCollection Class
https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#htmloptionscollection
public sealed class HtmlOptionsCollection : HtmlCollection- Inheritance
HtmlCollectionHtmlOptionsCollection
Properties
| Name | Description |
|---|---|
| Length | https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-length |
| SelectedIndex | Gets or sets the index of the first selected option, or -1 when no option is selected. |
Length
SelectElements.cshttps://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-length
public new uint Length { get; set; }SelectedIndex
SelectElements.csGets or sets the index of the first selected option, or -1 when no option is selected.
public int SelectedIndex { get; set; }Indexers
| Name | Description |
|---|---|
| this[uint] | The indexed setter (https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-setter). |
this[uint]
SelectElements.csThe indexed setter (https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-setter).
public new HtmlOptionElement? this[uint index] { get; set; }Methods
| Name | Description |
|---|---|
| Add(HtmlElement, HtmlElement?) | https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-add |
| Add(HtmlElement, int) | Inserts an option or optgroup element before the option at the given index, or at the end when the index is invalid. |
| Remove(int) | https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-remove |
Add overloads
Add(HtmlElement, HtmlElement?)
SelectElements.cshttps://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-add
public void Add(HtmlElement element, HtmlElement? before = null)Add(HtmlElement, int)
SelectElements.csInserts an option or optgroup element before the option at the given index, or at the end when the index is invalid.
public void Add(HtmlElement element, int before)Remove(int)
SelectElements.cshttps://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-remove