Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input maxlength attribute

HTML maxlength property

HTML input Tag Reference HTML tag

Example

with a maximum length of 10 characters element:

Username:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the maxlength attribute.


Definition and Usage

The maxlength attribute specifies the maximum number of characters allowed in the element.


Differences between HTML 4.01 and HTML5

none.


Syntax

Attribute values

Value Description
number in maximum number of characters allowed in the element.

HTML input Tag Reference HTML tag