HtmlButtonElement Class

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

public sealed class HtmlButtonElement : HtmlElement
Inheritance
HtmlElement HtmlButtonElement

Properties

NameDescription
CommandGets or sets the value of the command content attribute.
CommandForElementGets or sets the element whose ID is the value of the commandfor 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.
FormActionGets or sets the value of the formaction content attribute.
FormEnctypeGets or sets the value of the formenctype content attribute, limited to the known values (the canonical keyword, or the default value).
FormMethodGets or sets the value of the formmethod content attribute, limited to the known values (the canonical keyword, or the default value).
FormNoValidateGets or sets a value indicating whether the element has the formnovalidate content attribute.
FormTargetGets or sets the value of the formtarget content attribute.
LabelsGets the label elements associated with the element.
NameGets or sets the value of the name content attribute.
PopoverTargetActionGets or sets the value of the popovertargetaction content attribute, limited to the known values (the canonical keyword, or the default value).
PopoverTargetElementGets or sets the element whose ID is the value of the popovertarget content attribute.
TypeGets or sets the value of the type content attribute.
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.
ValueGets or sets the value of the value content attribute.
WillValidateGets a value indicating whether the element is a candidate for constraint validation.

Gets or sets the value of the command content attribute.

public string Command { get; set; }

CommandForElement

HtmlElements.g.cs

Gets or sets the element whose ID is the value of the commandfor content attribute.

public Element? CommandForElement { 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 or sets the value of the formaction content attribute.

public string FormAction { get; set; }

Gets or sets the value of the formenctype content attribute, limited to the known values (the canonical keyword, or the default value).

public string FormEnctype { get; set; }

Gets or sets the value of the formmethod content attribute, limited to the known values (the canonical keyword, or the default value).

public string FormMethod { get; set; }

FormNoValidate

HtmlElements.g.cs

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

public bool FormNoValidate { get; set; }

Gets or sets the value of the formtarget content attribute.

public string FormTarget { get; set; }

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; }

PopoverTargetAction

HtmlElements.g.cs

Gets or sets the value of the popovertargetaction content attribute, limited to the known values (the canonical keyword, or the default value).

public string PopoverTargetAction { get; set; }

PopoverTargetElement

HtmlElements.g.cs

Gets or sets the element whose ID is the value of the popovertarget content attribute.

public Element? PopoverTargetElement { get; set; }

Gets or sets the value of the type content attribute.

public string Type { get; set; }

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; }

Gets or sets the value of the value content attribute.

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)