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
Form
Gets the associated HTML form element.
[DomName("form")]
IHtmlFormElement? Form { get; }
Property Value
IsDisabled
Gets or sets if the button is enabled or disabled.
[DomName("disabled")]
bool IsDisabled { get; set; }
Property Value
IsMultiple
Gets or sets the multiple HTML attribute, whichindicates whether multiple items can be selected.
[DomName("multiple")]
bool IsMultiple { get; set; }
Property Value
IsRequired
Gets or sets if the field is required.
[DomName("required")]
bool IsRequired { get; set; }
Property Value
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
intThe 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
Length
Gets the number of option elements in this select element.
[DomName("length")]
int Length { get; }
Property Value
Name
Gets or sets the name of the element.
[DomName("name")]
string? Name { get; set; }
Property Value
Options
Gets the set of option elements contained by this element.
[DomName("options")]
IHtmlOptionsCollection Options { get; }
Property Value
SelectedIndex
Gets the index of the first selected option element.
[DomName("selectedIndex")]
int SelectedIndex { get; }
Property Value
SelectedOptions
Gets the set of options that are selected.
[DomName("selectedOptions")]
IHtmlCollection<IHtmlOptionElement> SelectedOptions { get; }
Property Value
Size
Gets or sets the display size of the element.
[DomName("size")]
int Size { get; set; }
Property Value
Type
Gets the type of input element (select).
[DomName("type")]
string Type { get; }
Property Value
Value
Gets or sets the value.
[DomName("value")]
string? Value { get; set; }
Property Value
Methods
AddOption(IHtmlOptionElement, IHtmlElement?)
Adds an option element to the options collection.
[DomName("add")]
void AddOption(IHtmlOptionElement element, IHtmlElement? before = null)
Parameters
element
IHtmlOptionElementThe element to add.
before
IHtmlElementThe 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
IHtmlOptionsGroupElementThe element to add.
before
IHtmlElementThe optional reference element for inserting.
RemoveOptionAt(int)
Removes an element from the options collection.
[DomName("remove")]
void RemoveOptionAt(int index)
Parameters
index
intThe index of the element of remove.