HTML maxlength property
Example
with a maximum length of 10 characters element:
Try it »
Browser support





All major browsers support the maxlength attribute.
Definition and Usage
The maxlength attribute specifies the maximum number of characters allowed in the element.
Differences between HTML 4.01 and HTML5
none.
Syntax
Attribute values
| Value | Description |
|---|---|
| number | in maximum number of characters allowed in the element. |
HTML tag