HTML <textarea> maxlength Attribute

The maxlength attribute on a <textarea> tag specifies the maximum number of characters that can be entered in the textarea.

Example

#

A maxlength attribute on a <textarea> element.
The maxlength specified the number of characters allowed in this textarea.

<textarea rows="3" cols="55" maxlength="50">
Textarea with a max of 50 characters
</textarea>

Using maxlength

The maxlength attribute specifies the maximum number of characters that can be entered in the texterea.

By default, the maximum is 524,288 characters.


Syntax

<textarea maxlength="number">

Values

#

Value Description
number The maximum number of characters.

Browser support

Here is when maxlength support started for each browser:

Chrome
1.0 Sep 2008
Firefox
4.0 Mar 2011
IE/Edge
10.0 Sep 2012
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <textarea>
Guides