The input element is the most flexible and versatile of the form controls.
- all inputs must apply a type attribute to determine how this input will function
- all inputs must have a descriptive name attribute. This will be used by the processing script to access the data.
- all inputs must have a descriptive id attribute (may be the same value as the name) to ensure the code is valid and allows labels to be applied
- text based inputs will reliably accept 2000+ characters of data
- always apply either a placeholder or label to ALL input elements
Examine the source code of this document for more details.
Semantic, Accessible Inputs
All inputs must have either a placeholder or label to ensure maximum accessibility:
A form with inputs using labels
A form with inputs using placeholder attribute
Input Variations
A very versatile element, how an input works is determined by its type attribute.