HTML 元素列表<input>maxlength本页总览maxlengthHTML <input> maxlength 属性最大长度为 10 个字符的 <input> 元素:实时编辑器<form action="/examples/web/html_form_action/"> Username: <input type="text" name="username" maxlength="10"/><br/> <input type="submit" value="提交"/> </form><form action="/examples/web/html_form_action/"> Username: <input type="text" name="username" maxlength="10"/><br/> <input type="submit" value="提交"/></form>结果Loading...定义和用法maxlength 属性规定 <input> 元素中允许的最大字符数。HTML 4.01 与 HTML5之间的差异无。语法<input maxlength="*number*">属性值值描述number在 <input> 元素中允许的最大字符数。