HtmlOutputElement Class

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

public sealed class HtmlOutputElement : HtmlElement
Inheritance
HtmlElement HtmlOutputElement

Properties

NameDescription
DefaultValuehttps://html.spec.whatwg.org/multipage/form-elements.html#dom-output-defaultvalue
FormGets the form owner of the element, or null when it has none.
HtmlForGets the tokens of the for content attribute.
LabelsGets the label elements associated with the element.
NameGets or sets the value of the name content attribute.
TypeGets the type of the control, always output.
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-output-value
WillValidateGets a value indicating whether the element is a candidate for constraint validation.

DefaultValue

SimpleControls.cs

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

public string DefaultValue { get; set; }

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

public HtmlFormElement? Form { get; }

Gets the tokens of the for content attribute.

public DomTokenList HtmlFor { get; }

Gets the label elements associated with the element.

public NodeList Labels { get; }

Gets or sets the value of the name content attribute.

public string Name { get; set; }

Gets the type of the control, always output.

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-output-value

public string Value { get; set; }

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

public bool WillValidate { get; }

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.
SetCustomValidity(string)Sets the custom validity error message of the element; an empty string clears the custom error.

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)