English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The maxlength attribute specifies the maximum number of characters allowed in the <input> element.
Limits the maximum length of the <input> element to15A string:
<!DOCTYPE html> <html> <head> <title>HTML:<input> maxlength Attribute - Basic Tutorial Website(oldtoolbag.com)<//title> <body> <form action="action_page.php"> Username: <input type="text" name="username" maxlength="15><br> <input type="submit" value="Submit"> </form> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the maxlength attribute.
The maxlength attribute specifies the maximum number of characters allowed in the <input> element.
None.
<input maxlength="number">
Value | Description |
---|---|
number | Allowed in the <input> elementMaximumNumber of characters. The default value is524288. |