HtmlTextAreaElement Class

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

public sealed class HtmlTextAreaElement : HtmlElement
Inheritance
HtmlElement HtmlTextAreaElement

Properties

NameDescription
AutocompleteGets or sets the value of the autocomplete content attribute.
ColsGets or sets the value of the cols content attribute.
DefaultValuehttps://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-defaultvalue
DirNameGets or sets the value of the dirname content attribute.
DisabledGets or sets a value indicating whether the element has the disabled content attribute.
FormGets the form owner of the element, or null when it has none.
LabelsGets the label elements associated with the element.
MaxLengthGets or sets the value of the maxlength content attribute.
MinLengthGets or sets the value of the minlength content attribute.
NameGets or sets the value of the name content attribute.
PlaceholderGets or sets the value of the placeholder content attribute.
ReadOnlyGets or sets a value indicating whether the element has the readonly content attribute.
RequiredGets or sets a value indicating whether the element has the required content attribute.
RowsGets or sets the value of the rows content attribute.
SelectionDirectionGets or sets the direction of the text selection (forward, backward or none).
SelectionEndGets or sets the index of the end of the text selection.
SelectionStartGets or sets the index of the start of the text selection.
TextLengthGets the length of the value of the control, in UTF-16 code units.
TypeGets the type of the control, always textarea.
ValidationMessageGets the error message that would be shown to the user if the element is invalid, or an empty string.
ValidityGets the ValidityState object that describes the validity of the element.
Valuehttps://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-value
WillValidateGets a value indicating whether the element is a candidate for constraint validation.
WrapGets or sets the value of the wrap content attribute.

Autocomplete

HtmlElements.g.cs

Gets or sets the value of the autocomplete content attribute.

public string Autocomplete { get; set; }

Gets or sets the value of the cols content attribute.

public uint Cols { get; set; }

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

public string DefaultValue { get; set; }

Gets or sets the value of the dirname content attribute.

public string DirName { get; set; }

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

public bool Disabled { get; set; }

Gets the form owner of the element, or null when it has none.

public HtmlFormElement? Form { get; }

Gets the label elements associated with the element.

public NodeList Labels { get; }

Gets or sets the value of the maxlength content attribute.

public int MaxLength { get; set; }

Gets or sets the value of the minlength content attribute.

public int MinLength { get; set; }

Gets or sets the value of the name content attribute.

public string Name { get; set; }

Gets or sets the value of the placeholder content attribute.

public string Placeholder { get; set; }

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

public bool ReadOnly { get; set; }

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

public bool Required { get; set; }

Gets or sets the value of the rows content attribute.

public uint Rows { get; set; }

SelectionDirection

HtmlTextAreaElement.cs

Gets or sets the direction of the text selection (forward, backward or none).

public string SelectionDirection { get; set; }

Gets or sets the index of the end of the text selection.

public uint SelectionEnd { get; set; }

Gets or sets the index of the start of the text selection.

public uint SelectionStart { get; set; }

Gets the length of the value of the control, in UTF-16 code units.

public uint TextLength { get; }

Gets the type of the control, always textarea.

public string Type { get; }

ValidationMessage

FormControlMembers.cs

Gets the error message that would be shown to the user if the element is invalid, or an empty string.

public string ValidationMessage { get; }

Gets the ValidityState object that describes the validity of the element.

public ValidityState Validity { get; }

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

public string Value { get; set; }

Gets a value indicating whether the element is a candidate for constraint validation.

public bool WillValidate { get; }

Gets or sets the value of the wrap content attribute.

public string Wrap { get; set; }

Methods

NameDescription
CheckValidity()Returns whether the element satisfies its constraints, firing an invalid event when it does not.
ReportValidity()Checks whether the element satisfies its constraints, firing an invalid event when it does not.
Select()Selects all the text of the control.
SetCustomValidity(string)Sets the custom validity error message of the element; an empty string clears the custom error.
SetRangeText(string)Replaces the selected text with the given text.
SetRangeText(string, uint, uint, string)Replaces the text between the start and end indexes with the given text and updates the selection according to the selection mode.
SetSelectionRange(uint, uint, string?)Selects the text between the start and end indexes, with the given direction.

CheckValidity()

FormControlMembers.cs

Returns whether the element satisfies its constraints, firing an invalid event when it does not.

public bool CheckValidity()

ReportValidity()

FormControlMembers.cs

Checks whether the element satisfies its constraints, firing an invalid event when it does not.

public bool ReportValidity()

SetCustomValidity(string)

FormControlMembers.cs

Sets the custom validity error message of the element; an empty string clears the custom error.

public void SetCustomValidity(string error)

SetRangeText overloads

SetRangeText(string)

HtmlTextAreaElement.cs

Replaces the selected text with the given text.

public void SetRangeText(string replacement)

SetRangeText(string, uint, uint, string)

HtmlTextAreaElement.cs

Replaces the text between the start and end indexes with the given text and updates the selection according to the selection mode.

public void SetRangeText(string replacement, uint start, uint end, string selectionMode = "preserve")

SetSelectionRange(uint, uint, string?)

HtmlTextAreaElement.cs

Selects the text between the start and end indexes, with the given direction.

public void SetSelectionRange(uint start, uint end, string? direction = null)