AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.2.5" />

.NET API 385,536 bytes

 HTMLOptionElement

public sealed class HTMLOptionElement : HTMLElement
Represents the HTML option element.
namespace AngleSharp.DOM.Html { public sealed class HTMLOptionElement : HTMLElement { internal const string Tag = "option"; private bool selectedness; public string Name { get { return GetAttribute("name"); } set { SetAttribute("name", value); } } public bool Disabled { get { return GetAttribute("disabled") != null; } set { SetAttribute("disabled", value ? string.Empty : null); } } public HTMLFormElement Form => GetAssignedForm(); public string Label { get { return GetAttribute("label"); } set { SetAttribute("label", value); } } public string Value { get { return GetAttribute("value"); } set { SetAttribute("value", value); } } public int Index { get { HTMLOptGroupElement hTMLOptGroupElement = _parent as HTMLOptGroupElement; if (hTMLOptGroupElement != null) { for (int i = 0; i < hTMLOptGroupElement.ChildElementCount; i++) { if (hTMLOptGroupElement.Children[i] == this) return i; } } return 0; } } public string Text { get { return TextContent.CollapseAndStrip(); } set { TextContent = value; } } public bool DefaultSelected { get { return GetAttribute("selected") != null; } set { SetAttribute("selected", value ? string.Empty : null); } } public bool Selected { get { return selectedness; } set { selectedness = value; } } protected internal override bool IsSpecial => false; internal HTMLOptionElement() { _name = "option"; Text = string.Empty; Value = string.Empty; Selected = false; DefaultSelected = false; } } }