Is there a minlength validation attribute in HTML5?

You can use the pattern attribute. The required attribute is also needed, otherwise an input field with an empty value will be excluded from constraint validation. If you want to create the option to use the pattern for “empty, or minimum length”, you could do the following: