Reference
Which attributes work with input type=text?
Use these attributes to name the field, guide input and apply browser validation. Validate submitted values on the server too.
| Attribute | What it does |
|---|---|
| name | The key sent with the field's value; an unnamed input is omitted. |
| value | Sets the initial text; the current value is submitted. |
| placeholder | Shows a short hint when empty; it does not replace a label. |
| required | Requires a nonempty value for browser validation. |
| maxlength | Limits input length in UTF-16 code units. |
| minlength | Sets the minimum length for a nonempty value in UTF-16 code units. |
| pattern | A regular expression the entire nonempty value must match. |
| size | A suggested visible width in characters, not a length limit. |
| readonly | Prevents editing while still allowing the named value to be submitted. |
| disabled | Disables the control and excludes it from submission. |
| autocomplete | Hints at the data to fill, with tokens such as name, given-name, family-name or organization. |
| inputmode | Hints at a virtual keyboard, such as text or numeric; it does not validate. |
| spellcheck | Hints whether the browser should check spelling: true or false. |
| list | References the id of a datalist offering suggestions. |
Sources: MDN: text input




