HTML <textarea> maxlength attribute

Definition and Usage

maxlength The attribute specifies the maximum length of the text area (in characters).

Example

Text area with a maximum length of 50 characters:

<textarea maxlength="50">
Please enter text here...
</textarea>

Try It Yourself

Syntax

<textarea maxlength="number">

Attribute Value

Value Description
number Specifies the maximum number of characters allowed in the text area.

Browser Support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 4.0 Support Support