Is there a minlength validation attribute in HTML5?
问题 It seems the minlength attribute for an <input> field doesn\'t work. Is there any other attribute in HTML5 with the help of which I can set the minimal length of a value for fields? 回答1: 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. <input pattern=".{3,}" required title="3 characters minimum"> <input pattern=".{5,10}" required title="5 to 10 characters"> If you want to create