HTML
Example
a text area with a maximum length of 50 characters:
Try it »
Browser support





Internet Explorer 10, Firefox, Chrome, and Safari support the maxlength attribute.
**Note:** Opera or Internet Explorer 9 and earlier versions do not support
All major browsers support the maxlength attribute except Internet Explorer and Opera.
Definition and Usage
The maxlength attribute specifies the maximum length of the text area (in characters).
Differences between HTML 4.01 and HTML5
The maxlength attribute is new in HTML5
Syntax
Attribute values
| Value | Description |
|---|---|
| number | the maximum number of characters allowed in the text area. |
HTML