HtmlOptionElement Class

https://html.spec.whatwg.org/multipage/form-elements.html#htmloptionelement

public sealed class HtmlOptionElement : HtmlElement
Inheritance
HtmlElement HtmlOptionElement

Properties

NameDescription
DefaultSelectedGets or sets a value indicating whether the element has the selected content attribute.
DisabledGets or sets a value indicating whether the element has the disabled content attribute.
Formhttps://html.spec.whatwg.org/multipage/form-elements.html#dom-option-form
Indexhttps://html.spec.whatwg.org/multipage/form-elements.html#concept-option-index
LabelGets or sets the value of the label content attribute.
Selectedhttps://html.spec.whatwg.org/multipage/form-elements.html#dom-option-selected
Texthttps://html.spec.whatwg.org/multipage/form-elements.html#dom-option-text
ValueGets or sets the value of the value content attribute.

DefaultSelected

HtmlElements.g.cs

Gets or sets a value indicating whether the element has the selected content attribute.

public bool DefaultSelected { get; set; }

Gets or sets a value indicating whether the element has the disabled content attribute.

public bool Disabled { get; set; }

https://html.spec.whatwg.org/multipage/form-elements.html#dom-option-form

public HtmlFormElement? Form { get; }

https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-index

public int Index { get; }

Gets or sets the value of the label content attribute.

public string Label { get; set; }

https://html.spec.whatwg.org/multipage/form-elements.html#dom-option-selected

public bool Selected { get; set; }

https://html.spec.whatwg.org/multipage/form-elements.html#dom-option-text

public string Text { get; set; }

Gets or sets the value of the value content attribute.

public string Value { get; set; }

Methods

NameDescription
Create(Document, string, string?, bool, bool)The Option() legacy factory function (https://html.spec.whatwg.org/multipage/form-elements.html#dom-option).

Create(Document, string, string?, bool, bool)

SelectElements.cs

The Option() legacy factory function (https://html.spec.whatwg.org/multipage/form-elements.html#dom-option).

public static HtmlOptionElement Create(Document document, string text = "", string? value = null, bool defaultSelected = false, bool selected = false)