HTMLInputElement
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The HTMLInputElement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements.
Instance properties
Also inherits properties from its parent interface, HTMLElement.
Some properties only apply to input element types that support the corresponding attributes.
align-
A string that represents the alignment of the element. Use CSS instead.
alpha-
A boolean that represents the element's
alphaattribute, indicating whether the color's alpha component can be manipulated by the end user and does not have to be fully opaque. colorSpace-
A string that represents the element's
colorspaceattribute, indicating the color space of the serialized CSS color (sRGB or display-p3). defaultValue-
A string that represents the default value as originally specified in the HTML that created this object.
dirName-
A string that represents the directionality of the element.
incremental-
A boolean that represents the search event fire mode, if
true, fires on every keypress, or on clicking the cancel button; otherwise fires when pressing Enter. labelsRead only-
Returns a list of
<label>elements that are labels for this element. listRead only-
Returns the element pointed to by the
listattribute. The property may benullif no HTML element is found in the same tree. multiple-
A boolean that represents the element's
multipleattribute, indicating whether more than one value is possible (e.g., multiple files). name-
A string that represents the element's
nameattribute, containing a name that identifies the element when submitting the form. popoverTargetAction-
Gets and sets the action to be performed (
"hide","show", or"toggle") on a popover element being controlled by an<input>element oftype="button". It reflects the value of thepopovertargetactionHTML attribute. popoverTargetElement-
Gets and sets the popover element to control via an
<input>element oftype="button". The JavaScript equivalent of thepopovertargetHTML attribute. step-
A string that represents the element's
stepattribute, which works withminandmaxto limit the increments at which a numeric or date-time value can be set. It can be the stringanyor a positive floating point number. If this is not set toany, the control accepts only values at multiples of the step value greater than the minimum. type-
A string that represents the element's
typeattribute, indicating the type of control to display. For possible values, see the documentation for thetypeattribute. useMap-
A string that represents a client-side image map.
value-
A string that represents the current value of the control. If the user enters a value different from the value expected, this may return an empty string.
valueAsDate-
A
Datethat represents the value of the element, interpreted as a date, ornullif conversion is not possible. valueAsNumber-
A number that represents the value of the element, interpreted as one of the following, in order: A time value, a number, or
NaNif conversion is impossible.
Instance properties related to the parent form
formRead only-
Returns a reference to the parent
<form>element. formAction-
A string that represents the element's