HTML <input> minlength Atribut
Příklad
Prvek <input> s minimální délkou 8 znaků:
<form
action="/action_page.php">
<label for="password">Password:</label>
<input type="password"
id="password" name="password" minlength="8"><br><br>
<input
type="submit" value="Submit">
</form>
Definice a použití
Atribut minlength
určuje minimální počet znaků požadovaných ve vstupním poli.
Poznámka: Atribut minlength
lze použít s typem vstupu: text, hledání, url, tel, e-mail a heslo.
Podpora prohlížeče
Čísla v tabulce určují první verzi prohlížeče, která tento atribut plně podporuje.
Attribute | |||||
---|---|---|---|---|---|
minlength | 40.0 | 17.0 | 51.0 | 10.1 | 27.0 |
Syntax
<input minlength="number">
Hodnoty atributů
Value | Description |
---|---|
number | The minimum number of characters required in an <input> element |
❮ HTML tag <input>