html input maxlength minlength code example
Example 1: input maxlength
<form action="/action_page.php">
<label for="username">Username:</label>
<input type="text" id="username" name="username" maxlength="10"><br><br>
<input type="submit" value="Submit">
</form>
Example 2: html5 input required length
<input pattern=".{3,}" required title="3 characters minimum">
<input pattern=".{5,10}" required title="5 to 10 characters">
Example 3: html input max vs maxlength
<input type="text" maxlength="4"/>