HTML textarea maxlength attribute
Examples
The maximum length is 50 characters in the text area:
<textarea maxlength="50">
输入内容...
</textarea>
输入内容...
</textarea>
try it"
Browser Support
Internet Explorer 10, Firefox, Chrome and Safari support maxlength attribute.
Note: Opera or Internet Explorer 9 and earlier versions do not support maxlength attribute <textarea> tag.
In addition to Internet Explorer and Opera, the other major browsers support maxlength attribute.
Definition and Usage
Maxlength attribute specifies the maximum length of the text area (in characters).
Differences between HTML 4.01 and HTML5
maxlength attribute is new in HTML5 attribute <textarea> tag.
grammar
<textarea maxlength=" number ">
Property Value
值 | 描述 |
---|---|
number | 在文本区域中允许的最大字符数。 |
HTML <textarea> tag