HTML <input> minlength Attribute

❮ HTML <input> tag

Example

<form action="action.php">
  <label for="username">Username:</label>
  <input type="text" id="username" name="username" minlength="6" maxlength="10">

  <label for="pasw">Password:</label>
  <input type="password" id="pasw" name="password" minlength="8" maxlength="16">

  <input type="submit" value="Submit">
</form>

Meaning

The minlength attribute specifies the mainimum content length that can be entered in a text form control.

The minlength attribute is valid for password, search, tel, text, url


Standard Syntax

HTML: <input minlength="number">

XHTML: <input minlength="number"/>



Browser Support




Status







Attribute Values

Value Description
number Specifies the minimum number of characters allowed in the <input> element.
❮ HTML <input> tag