HTMLInputElement object
Implements the document object model (DOM) representation of the input element.
![]() |
DOM Information
Inheritance Hierarchy
Members
The HTMLInputElement object has these types of members:
Methods
The HTMLInputElement object has these methods.
| Method | Description |
|---|---|
| checkValidity |
Returns whether a form will validate when it is submitted, without having to submit it. |
| getBoundingClientRect |
Retrieves an object that specifies the bounds of a collection of TextRectangle objects. |
| getClientRects |
Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line. |
| setCustomValidity |
Sets a custom error message that is displayed when a form is submitted. |
| stepDown |
Decrements a range input control's value by the value given by the Step attribute. |
| stepUp |
Increments a range input control's value by the value given by the Step attribute. |
Properties
The HTMLInputElement object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read/write |
Specifies whether autocomplete is applied to an editable text field. | |
|
Read/write |
Provides a way to direct a user to a specific field when a document loads. | |
|
Read-only |
Returns a FileList object on a file type input object. | |
|
Read/write |
Overrides the action attribute (where the data on a form is sent) on the parent form element. | |
|
Read/write |
Used to override the encoding (formEnctype attribute) specified on the form element. | |
|
Read/write |
Overrides the submit method attribute previously specified on a form element. | |
|
Read/write |
Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. | |
|
Read/write |
Overrides the target attribute on a form element. | |
|
Read-only |
Specifies the ID of a pre-defined datalist of options for an input element. | |
|
Read/write |
Defines the maximum acceptable value for an input element with type="number". | |
|
Sets or retrieves the maximum number of characters that the user can enter in a text control. | ||
|
Read/write |
Defines the minimum acceptable value for an input element with type="number". | |
|
Read/write |
When used with the type="file" attribute, allows multiple files to be selected in the file selection dialog. | |
|
Read/write |
Gets or sets a string containing a regular expression that the user's input must match. | |
|
Read/write |
Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter. | |
|
Read/write |
When present, marks an element that can't be submitted without a value. | |
|
Gets the string corresponding to the current selection's direction. | ||
|
Gets or sets the end position or offset of a text selection. | ||
|
Gets or sets the starting position or offset of a text selection. | ||
|
Read/write |
Specifies whether spell checking is applied to an editable text field. | |
|
Sets or retrieves a URL to be loaded by the object. | ||
|
Read/write |
Defines an increment or jump between values that you want to allow the user to enter. | |
|
Retrieves or initially sets the type of input control represented by the object. | ||
|
Read-only |
Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. | |
|
Read-only |
Returns a ValidityState object that represents the validity states of an element. | |
|
Read/write |
Returns the input field value as a number. | |
|
Provides a means for selecting a folder when using input. | ||
|
Read-only |
Returns whether an element will successfully validate based on forms validation rules and constraints. |
See also
