maxlength Attributemaxlength Attributemaxlength is declared on the elements: input type="text", input type="password"The maxlength attribute specifies the maximum number of characters
which may be accepted by
input type="text" or
input type="password"
form controls. The user is prevented from entering more than this number of characters
into the text field. In the absence of this attribute, there is no limit to the number
of characters entered.
Note: It should not be assumed in the server processing script that you
will never receive a value longer than this for the field in question - it is always possible,
for example, to receive data from another form
which does not have this restriction or for someone to alter the query string directly in the
URI.
See also the size attribute.