HTML input maxlength Attribute
HTML <input> tag
Definition and Usage
The maxlength attribute specifies the maximum number of characters allowed in
a input field.
This attribute is only used if the type attribute of the input element is set
to "text" or "password".
Syntax
<input maxlength="characters" />
|
Syntax Example
Attribute Values
Value |
Description |
characters |
The maximum number of characters allowed in the input
field. |
Browser Support

The attribute is supported in all major browsers.
Example
<form action="">
<input type="text" name="demo" maxlength="10" />
</form>
|
Try-It-Yourself Demos
input
maxlength attribute example
How use the maxlength attribute with the input type="text".
HTML <input> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|