Table of Contents

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

int

Methods

Add(IHtmlOptionElement, IHtmlElement?)

Adds an option element to the collection.

[DomName("add")]
void Add(IHtmlOptionElement element, IHtmlElement? before = null)

Parameters

element IHtmlOptionElement

The element to add.

before IHtmlElement

The 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 IHtmlOptionsGroupElement

The element to add.

before IHtmlElement

The 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 int

The 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 int

The 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 int

The index of the element.

option IHtmlOptionElement

The option to set at the given position.