Video tutorialTrack course · freeCodeCamp
Speed
Transcript & captions
5/5
Forms collect user input. Every input should have a <label> connected with the for attribute matching the input's id — it improves accessibility and makes the label clickable.
| type | Use |
|---|---|
| text | Single line of text |
| Email with built-in validation | |
| password | Masked characters |
| number | Numeric with min/max/step |
| checkbox / radio | Multiple or single choice |
| date / time | Native pickers |
| range | Slider |
| file | Upload |
Try it yourself
Knowledge check
0/1 answeredWhich attribute links a <label> to its input?