Attributes
The input element accepts attributes like placeholder, value, and name to define its behavior.
value
The value attribute specifies the initial value for an input field.
readonly
The readonly attribute specifies that the input field is read only (cannot be changed).
disabled
The disabled attribute specifies that the input field is disabled. A disabled input field is unusable and unclickable, and its value will not be sent when submitting a form.
size
The size attribute specifies the size (in characters) for the input field.
maxlength
The maxlength attribute specifies the maximum allowed length for the input field. With a maxlength attribute, the input field will not accept more than the allowed number of characters.
min and max
The min and max attributes specify the minimum and maximum values for an <input />
element.
step
The step attribute specifies the legal number of intervals for an <input />
element.
placeholder
The placeholder attribute specifies a hint describing an input field’s expected value. The hint is displayed in the field before the user enters a value.
required
The required attribute specifies that an input field must be filled out before submitting the form.
autofocus
The autofocus attribute specifies that an input field should automatically get focus when the page loads.
pattern
The pattern attribute specifies a regular expression that the input element’s value is checked against.
title
The title attribute is used to describe the pattern to the user.