HTML Form Validation is heavily underused
published on 2024/10/29
Beyond that, there is a bunch of other ways that you can add constraints to your input. Precisely, there are three ways to do it:
- Using specific type attribute values, such as "email", "number", or "url"
- Using other input attributes that create constraints, such as "pattern" or "maxlength"
- Using the setCustomValidity DOM method of the input