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

HTML DOM Password maxLength Property

Password maxLength Property

Password Object Reference Password Object


Definition and Usage

The maxLength property sets or returns the maximum number of characters allowed in the password field.

Syntax

Set the maxLength property:

passwordObject.maxLength=

integer

Return the maxLength property:

passwordObject.maxLength


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the maxLength property


Example

Example

The following example displays the maximum number of characters allowed in the specified password field:

Runoob Tutorial(runoob.com)

Password:

Try it »


Password Object Reference Password Object