HTML Input Attributes
All HTML topics∙ Chapter 68
HTML Input Attributes
Input attributes add constraints and improve UX (validation, keyboards, autofill). They also help accessibility.
| Attribute | Use | Example |
|---|---|---|
| required | Must be filled | required |
| placeholder | Hint text | placeholder="Email" |
| min / max | Numeric bounds | min="1" |
| pattern | Regex pattern | pattern="\\d{10}" |
| autocomplete | Autofill hint | autocomplete="email" |
⚠️Client-side validation helps UX, but always validate again on the server.