maxLength attribute (input, isindex)
Sets the maximum number of characters allowed in a text box.
If the maximum number of characters is reached, the user cannot add more characters to the contents of the input element.
Integer that sets the maximum length of text, in characters. Zero and negative integers mean that no characters can be entered into the input box.
Default: this attribute has no default value.
Example HTML code 1:
This example illustrates the use of the maxLength attribute:
Did you find this example helpful?
Supported by tags:
User Contributed Comments