Get the maximum number of characters allowed in a specific text area:
The result of x will be:
The maxLength property sets or returns the value of the maxlength attribute of a text area.
The maxLength attribute specifies the maximum number of characters allowed in a text area.
The maxLength property is supported in all major browsers, except Internet Explorer 9 and earlier versions, and Opera 12 and earlier versions.
Return the maxLength property:
Set the maxLength property:
Value | Description |
---|---|
number | Specifies the maximum number of characters allowed in the text area |
Return Value: | A Number, representing the maximum number of characters allowed in the text area |
---|
Change the maximum number of characters allowed in a text area:
HTML reference: HTML <textarea> maxlength attribute