HTML Input Attributes:
These are the following Input Attributes:
Value Attribute:
The input value attribute specifies an initial value for an input field
Readonly Attribute:
The input readonly attribute specifies that an input field is read-only. A read-only input field cannot be modified (however, a user can tab to it, highlight it, and copy the text from it).
Disabled Attribute:
The input disabled attribute specifies that an input field should be disabled. A disabled input field is unusable and un-clickable.
Size Attribute:
The input size attribute specifies the visible width, in characters, of an input field. The default value for size is 20.
Maxlength Attribute:
The input maxlength attribute specifies the maximum number of characters allowed in an input field.
Min & Max Attributes:
The input min and max attributes specify the minimum and maximum values for an input field. The min and max attributes work with the following input types: number, range, date, datetime-local, month, time, and week.
Multiple Attribute:
The input multiple attributes specifies that the user is allowed to enter more than one value in an input field.
Pattern Attribute:
The input pattern attribute specifies a regular expression that the input field’s value is checked against when the form is submitted.
Placeholder Attribute:
The input placeholder attribute specifies a short hint that describes the expected value of an input field (a sample value or a short description of the expected format).
Required Attribute:
The input required attribute specifies that an input field must be filled out before submitting the form.
Step Attribute:
The input step attribute specifies the legal number intervals for an input field. Example: if step=”3″, legal numbers could be -3, 0, 3, 6, etc.
Autofocus Attribute:
The input autofocus attribute specifies that an input field should automatically get focused when the page loads.
Height & Width Attributes:
The input height and width attributes specify the height and width of an <input type=”image”> element.
List Attribute:
The input list attribute refers to a <datalist> element that contains pre-defined options for an <input> element.
Autocomplete Attribute:
The input autocomplete attribute specifies whether a form or an input field should have to autocomplete on or off. Autocomplete allows the browser to predict the value.
When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values.