Lesson 5 of 55
HTMLBasic Form Controls – Textual Inputs
10 min
Course progress9%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 5 of 55
HTML10 min
Keep these ideas in mind as you work through the lesson.
<label for='name'>Name:</label>
<input type='text' id='name' name='name' required minlength='2' autocomplete='name' placeholder='John Doe' />
<label for='email'>Email:</label>
<input type='email' id='email' name='email' required autocomplete='email' />
type='text' – Generic text.type='email' – Validates email format; brings up an email‑optimized keyboard on mobile.type='url', type='tel', type='search' – Specialized keyboards and validation.type='password' – Hides characters; browsers may offer password‑manager integration.required – Field must be filled before submission.pattern – Custom regular expression.minlength, maxlength – Character count limits.autocomplete – Hints for browsers to pre‑fill fields.placeholder – Short hint visible inside the field; never replace a real <label>.<label> with the control using for/id. This expands the clickable target and improves screen‑reader navigation.<label> correctly linked via for/id? ✅type matches expected data (email, url, tel, etc.)? ✅required added where needed? ✅autocomplete attribute present and appropriate? ✅placeholder used only as a hint, not a replacement for <label>? ✅Tip: Match the
typeto the expected data (e.g.,