Get the maximum number of characters allowed in a specific password field:
The result of x will be:
The maxLength property sets or returns the value of the maxlength attribute of a password field.
The maxlength attribute specifies the maximum number of characters allowed in a password field.
Tip: To set or return the width of a password field, in number of characters, use the size property.
The maxLength property is supported in all major browsers.
Return the maxLength property:
Set the maxLength property:
Value | Description |
---|---|
integer | Specifies the maximum number of characters allowed in the password field |
Return Value: | A Number, representing the maximum number of characters allowed in the password field |
---|
Set the maximum number of characters allowed in a password field:
HTML reference: HTML <input> maxlength attribute