HtmlInputElement Class
https://html.spec.whatwg.org/multipage/input.html#htmlinputelement
public sealed class HtmlInputElement : HtmlElement- Inheritance
HtmlElementHtmlInputElement
Properties
| Name | Description |
|---|---|
| Accept | Gets or sets the value of the accept content attribute. |
| Align | Gets or sets the value of the align content attribute. |
| Alpha | Gets or sets a value indicating whether the element has the alpha content attribute. |
| Alt | Gets or sets the value of the alt content attribute. |
| Autocomplete | Gets or sets the value of the autocomplete content attribute. |
| Checked | https://html.spec.whatwg.org/multipage/input.html#dom-input-checked |
| ColorSpace | Gets or sets the value of the colorspace content attribute, limited to the known values (the canonical keyword, or the default value). |
| DefaultChecked | Gets or sets a value indicating whether the element has the checked content attribute. |
| DefaultValue | Gets or sets the value of the value content attribute. |
| DirName | Gets or sets the value of the dirname content attribute. |
| Disabled | Gets or sets a value indicating whether the element has the disabled content attribute. |
| Files | https://html.spec.whatwg.org/multipage/input.html#dom-input-files |
| Form | Gets the form owner of the element, or null when it has none. |
| FormAction | Gets or sets the value of the formaction content attribute. |
| FormEnctype | Gets or sets the value of the formenctype content attribute, limited to the known values (the canonical keyword, or the default value). |
| FormMethod | Gets or sets the value of the formmethod content attribute, limited to the known values (the canonical keyword, or the default value). |
| FormNoValidate | Gets or sets a value indicating whether the element has the formnovalidate content attribute. |
| FormTarget | Gets or sets the value of the formtarget content attribute. |
| Height | Gets or sets the value of the height content attribute. |
| Hspace | Gets or sets the value of the hspace content attribute. |
| Indeterminate | Gets or sets a value indicating whether the checkbox is in the indeterminate state. |
| Labels | Gets the label elements associated with the element. |
| List | https://html.spec.whatwg.org/multipage/input.html#dom-input-list |
| Max | Gets or sets the value of the max content attribute. |
| MaxLength | Gets or sets the value of the maxlength content attribute. |
| Min | Gets or sets the value of the min content attribute. |
| MinLength | Gets or sets the value of the minlength content attribute. |
| Multiple | Gets or sets a value indicating whether the element has the multiple content attribute. |
| Name | Gets or sets the value of the name content attribute. |
| Pattern | Gets or sets the value of the pattern content attribute. |
| Placeholder | Gets or sets the value of the placeholder content attribute. |
| PopoverTargetAction | Gets or sets the value of the popovertargetaction content attribute, limited to the known values (the canonical keyword, or the default value). |
| PopoverTargetElement | Gets or sets the element whose ID is the value of the popovertarget content attribute. |
| ReadOnly | Gets or sets a value indicating whether the element has the readonly content attribute. |
| Required | Gets or sets a value indicating whether the element has the required content attribute. |
| SelectionDirection | Gets or sets the direction of the text selection (forward, backward or none), or null when the selection does not apply to the input type. |
| SelectionEnd | Gets or sets the index of the end of the text selection, or null when the selection does not apply to the input type. |
| SelectionStart | Gets or sets the index of the start of the text selection, or null when the selection does not apply to the input type. |
| Size | Gets or sets the value of the size content attribute. |
| Src | Gets or sets the src content attribute, as a URL resolved against the base URL of the document. |
| Step | Gets or sets the value of the step content attribute. |
| Type | Gets or sets the value of the type content attribute, limited to the known values (the canonical keyword, or the default value). |
| UseMap | Gets or sets the value of the usemap content attribute. |
| ValidationMessage | Gets the error message that would be shown to the user if the element is invalid, or an empty string. |
| Validity | Gets the ValidityState object that describes the validity of the element. |
| Value | https://html.spec.whatwg.org/multipage/input.html#dom-input-value |
| ValueAsDate | https://html.spec.whatwg.org/multipage/input.html#dom-input-valueasdate |
| ValueAsNumber | https://html.spec.whatwg.org/multipage/input.html#dom-input-valueasnumber |
| Vspace | Gets or sets the value of the vspace content attribute. |
| Width | Gets or sets the value of the width content attribute. |
| WillValidate | Gets a value indicating whether the element is a candidate for constraint validation. |
Accept
HtmlElements.g.csGets or sets the value of the accept content attribute.
public string Accept { get; set; }Align
HtmlElements.g.csGets or sets the value of the align content attribute.
public string Align { get; set; }Alpha
HtmlElements.g.csGets or sets a value indicating whether the element has the alpha content attribute.
public bool Alpha { get; set; }Gets or sets the value of the alt content attribute.
public string Alt { get; set; }Autocomplete
HtmlElements.g.csGets or sets the value of the autocomplete content attribute.
public string Autocomplete { get; set; }Checked
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/input.html#dom-input-checked
public bool Checked { get; set; }ColorSpace
HtmlElements.g.csGets or sets the value of the colorspace content attribute, limited to the known values (the canonical keyword, or the default value).
public string ColorSpace { get; set; }DefaultChecked
HtmlElements.g.csGets or sets a value indicating whether the element has the checked content attribute.
public bool DefaultChecked { get; set; }Property value
See also
DefaultValue
HtmlElements.g.csGets or sets the value of the value content attribute.
public string DefaultValue { get; set; }Property value
See also
DirName
HtmlElements.g.csGets or sets the value of the dirname content attribute.
public string DirName { get; set; }Disabled
HtmlElements.g.csGets or sets a value indicating whether the element has the disabled content attribute.
public bool Disabled { get; set; }Files
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/input.html#dom-input-files
public FileList? Files { get; set; }Gets the form owner of the element, or null when it has none.
public HtmlFormElement? Form { get; }FormAction
HtmlElements.g.csGets or sets the value of the formaction content attribute.
public string FormAction { get; set; }FormEnctype
HtmlElements.g.csGets 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; }FormMethod
HtmlElements.g.csGets 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.csGets or sets a value indicating whether the element has the formnovalidate content attribute.
public bool FormNoValidate { get; set; }FormTarget
HtmlElements.g.csGets or sets the value of the formtarget content attribute.
public string FormTarget { get; set; }Height
HtmlElements.g.csGets or sets the value of the height content attribute.
public uint Height { get; set; }Hspace
HtmlElements.g.csGets or sets the value of the hspace content attribute.
public uint Hspace { get; set; }Indeterminate
HtmlInputElement.csGets or sets a value indicating whether the checkbox is in the indeterminate state.
public bool Indeterminate { get; set; }Labels
FormControlMembers.csGets the label elements associated with the element.
public NodeList? Labels { get; }https://html.spec.whatwg.org/multipage/input.html#dom-input-list
public HtmlDataListElement? List { get; }Property value
See also
Gets or sets the value of the max content attribute.
public string Max { get; set; }MaxLength
HtmlElements.g.csGets or sets the value of the maxlength content attribute.
public int MaxLength { get; set; }Gets or sets the value of the min content attribute.
public string Min { get; set; }MinLength
HtmlElements.g.csGets or sets the value of the minlength content attribute.
public int MinLength { get; set; }Multiple
HtmlElements.g.csGets or sets a value indicating whether the element has the multiple content attribute.
public bool Multiple { get; set; }Gets or sets the value of the name content attribute.
public string Name { get; set; }Pattern
HtmlElements.g.csGets or sets the value of the pattern content attribute.
public string Pattern { get; set; }Placeholder
HtmlElements.g.csGets or sets the value of the placeholder content attribute.
public string Placeholder { get; set; }PopoverTargetAction
HtmlElements.g.csGets 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.csGets or sets the element whose ID is the value of the popovertarget content attribute.
public Element? PopoverTargetElement { get; set; }ReadOnly
HtmlElements.g.csGets or sets a value indicating whether the element has the readonly content attribute.
public bool ReadOnly { get; set; }Required
HtmlElements.g.csGets or sets a value indicating whether the element has the required content attribute.
public bool Required { get; set; }SelectionDirection
HtmlInputElement.csGets or sets the direction of the text selection (forward, backward or none), or null when the selection does not apply to the input type.
public string? SelectionDirection { get; set; }SelectionEnd
HtmlInputElement.csGets or sets the index of the end of the text selection, or null when the selection does not apply to the input type.
public uint? SelectionEnd { get; set; }SelectionStart
HtmlInputElement.csGets or sets the index of the start of the text selection, or null when the selection does not apply to the input type.
public uint? SelectionStart { get; set; }Gets or sets the value of the size content attribute.
public uint Size { get; set; }Gets or sets the src content attribute, as a URL resolved against the base URL of the document.
public string Src { get; set; }Gets or sets the value of the step content attribute.
public string Step { get; set; }Gets or sets the value of the type content attribute, limited to the known values (the canonical keyword, or the default value).
public string Type { get; set; }UseMap
HtmlElements.g.csGets or sets the value of the usemap content attribute.
public string UseMap { get; set; }ValidationMessage
FormControlMembers.csGets the error message that would be shown to the user if the element is invalid, or an empty string.
public string ValidationMessage { get; }Validity
FormControlMembers.csGets the ValidityState object that describes the validity of the element.
public ValidityState Validity { get; }Value
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/input.html#dom-input-value
public string Value { get; set; }ValueAsDate
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/input.html#dom-input-valueasdate
public DateTime? ValueAsDate { get; set; }Property value
See also
ValueAsNumber
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/input.html#dom-input-valueasnumber
public double ValueAsNumber { get; set; }Property value
See also
Vspace
HtmlElements.g.csGets or sets the value of the vspace content attribute.
public uint Vspace { get; set; }Width
HtmlElements.g.csGets or sets the value of the width content attribute.
public uint Width { get; set; }WillValidate
FormControlMembers.csGets a value indicating whether the element is a candidate for constraint validation.
public bool WillValidate { get; }Methods
| Name | Description |
|---|---|
| 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() | https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-select |
| 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. |
| ShowPicker() | https://html.spec.whatwg.org/multipage/input.html#dom-input-showpicker |
| StepDown(int) | Decreases the value by the given number of steps (one by default) of the step attribute. |
| StepUp(int) | Increases the value by the given number of steps (one by default) of the step attribute. |
CheckValidity()
FormControlMembers.csReturns whether the element satisfies its constraints, firing an invalid event when it does not.
public bool CheckValidity()ReportValidity()
FormControlMembers.csChecks whether the element satisfies its constraints, firing an invalid event when it does not.
public bool ReportValidity()Select()
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-select
public void Select()SetCustomValidity(string)
FormControlMembers.csSets the custom validity error message of the element; an empty string clears the custom error.
SetRangeText overloads
SetRangeText(string)
HtmlInputElement.csReplaces the selected text with the given text.
SetRangeText(string, uint, uint, string)
HtmlInputElement.csSetSelectionRange(uint, uint, string?)
HtmlInputElement.csSelects the text between the start and end indexes, with the given direction.
Parameters
See also
ShowPicker()
HtmlInputElement.cshttps://html.spec.whatwg.org/multipage/input.html#dom-input-showpicker
public void ShowPicker()StepDown(int)
HtmlInputElement.csDecreases the value by the given number of steps (one by default) of the step attribute.
StepUp(int)
HtmlInputElement.csIncreases the value by the given number of steps (one by default) of the step attribute.