![]() |
VOOZH | about |
The maxlength attribute is used to define the maximum number of characters allowed in an input field. It helps restrict the length of user input.
Syntax:
<input maxlength="number">Here are some examples of using maxlength attribute:
The maxlength attribute is used within <input> elements to restrict the length of text inputs for username and password fields.
Here, the maxlength attribute limits the length of an email input field to 30 characters.