Easy Tutorial
❮ Js Tutorial Ref Byfunc ❯

HTML <input> maxlength Attribute

HTML <input> Tag

Example

An <input> element with a maximum length of 10 characters:


Browser Support

All major browsers support the maxlength attribute.


Definition and Usage

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


Differences Between HTML 4.01 and HTML5

None.


Syntax

Attribute Values

Value Description
number The maximum number of characters allowed in the <input> element.

❮ Js Tutorial Ref Byfunc ❯