Interface IHtmlOptionsCollection
- Namespace
- AngleSharp.Html.Dom
- Assembly
- AngleSharp.dll
Represents a collection of HTML option elements.
[DomName("HTMLOptionsCollection")]
public interface IHtmlOptionsCollection : IHtmlCollection<IHtmlOptionElement>, IEnumerable<IHtmlOptionElement>, IEnumerable
- Inherited Members
- Extension Methods
Properties
SelectedIndex
Gets or sets the selected index.
[DomName("selectedIndex")]
int SelectedIndex { get; set; }
Property Value
Methods
Add(IHtmlOptionElement, IHtmlElement?)
Adds an option element to the collection.
[DomName("add")]
void Add(IHtmlOptionElement element, IHtmlElement? before = null)
Parameters
element
IHtmlOptionElementThe element to add.
before
IHtmlElementThe optional reference element for inserting.
Add(IHtmlOptionsGroupElement, IHtmlElement?)
Adds an options group element to the collection.
[DomName("add")]
void Add(IHtmlOptionsGroupElement element, IHtmlElement? before = null)
Parameters
element
IHtmlOptionsGroupElementThe element to add.
before
IHtmlElementThe optional reference element for inserting.
GetOptionAt(int)
Gets an HTML option element at the specified index.
[DomAccessor(Accessors.Getter)]
IHtmlOptionElement GetOptionAt(int index)
Parameters
index
intThe index of the element.
Returns
- IHtmlOptionElement
The option at the given position.
Remove(int)
Removes an element from the collection.
[DomName("remove")]
void Remove(int index)
Parameters
index
intThe index of the element of remove.
SetOptionAt(int, IHtmlOptionElement)
Sets an HTML option element at the specified index.
[DomAccessor(Accessors.Setter)]
void SetOptionAt(int index, IHtmlOptionElement option)
Parameters
index
intThe index of the element.
option
IHtmlOptionElementThe option to set at the given position.