Table of Contents

Interface IHtmlSelectElement

Namespace
AngleSharp.Html.Dom
Assembly
AngleSharp.dll

Represents the select HTML element.

[DomName("HTMLSelectElement")]
public interface IHtmlSelectElement : IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IGlobalEventHandlers, IValidation
Inherited Members
Extension Methods

Properties

Autofocus

Gets or sets the autofocus HTML attribute, which indicates whether the control should have input focus when the page loads.

[DomName("autofocus")]
bool Autofocus { get; set; }

Property Value

bool

Form

Gets the associated HTML form element.

[DomName("form")]
IHtmlFormElement? Form { get; }

Property Value

IHtmlFormElement

IsDisabled

Gets or sets if the button is enabled or disabled.

[DomName("disabled")]
bool IsDisabled { get; set; }

Property Value

bool

IsMultiple

Gets or sets the multiple HTML attribute, whichindicates whether multiple items can be selected.

[DomName("multiple")]
bool IsMultiple { get; set; }

Property Value

bool

IsRequired

Gets or sets if the field is required.

[DomName("required")]
bool IsRequired { get; set; }

Property Value

bool

this[int]

Gets or sets an HTML option element at the specified index.

[DomAccessor(Accessors.Getter|Accessors.Setter)]
IHtmlOptionElement this[int index] { get; set; }

Parameters

index int

The index of the element.

Property Value

IHtmlOptionElement

The option at the given position.

Labels

Gets the list of assigned labels.

[DomName("labels")]
INodeList Labels { get; }

Property Value

INodeList

Length

Gets the number of option elements in this select element.

[DomName("length")]
int Length { get; }

Property Value

int

Name

Gets or sets the name of the element.

[DomName("name")]
string? Name { get; set; }

Property Value

string

Options

Gets the set of option elements contained by this element.

[DomName("options")]
IHtmlOptionsCollection Options { get; }

Property Value

IHtmlOptionsCollection

SelectedIndex

Gets the index of the first selected option element.

[DomName("selectedIndex")]
int SelectedIndex { get; }

Property Value

int

SelectedOptions

Gets the set of options that are selected.

[DomName("selectedOptions")]
IHtmlCollection<IHtmlOptionElement> SelectedOptions { get; }

Property Value

IHtmlCollection<IHtmlOptionElement>

Size

Gets or sets the display size of the element.

[DomName("size")]
int Size { get; set; }

Property Value

int

Type

Gets the type of input element (select).

[DomName("type")]
string Type { get; }

Property Value

string

Value

Gets or sets the value.

[DomName("value")]
string? Value { get; set; }

Property Value

string

Methods

AddOption(IHtmlOptionElement, IHtmlElement?)

Adds an option element to the options collection.

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

Parameters

element IHtmlOptionElement

The element to add.

before IHtmlElement

The optional reference element for inserting.

AddOption(IHtmlOptionsGroupElement, IHtmlElement?)

Adds an options group element to the options collection.

[DomName("add")]
void AddOption(IHtmlOptionsGroupElement element, IHtmlElement? before = null)

Parameters

element IHtmlOptionsGroupElement

The element to add.

before IHtmlElement

The optional reference element for inserting.

RemoveOptionAt(int)

Removes an element from the options collection.

[DomName("remove")]
void RemoveOptionAt(int index)

Parameters

index int

The index of the element of remove.