1. Form basics
<form action="/signup" method="post">
<label for="email">Email</label>
<input type="email" id="email" name="email" required placeholder="you@example.com">
<label for="pwd">Password</label>
<input type="password" id="pwd" name="pwd" required minlength="8">
<button type="submit">Create account</button>
</form>Every input needs a <label for="id"> — clicking the label focuses the input (accessibility). required blocks empty submits.
2. Input types
text, email, password, number, date, tel, url, searchtextareafor multi-line,selectfor dropdown,checkbox/radiofor choices
Use correct type — mobile shows right keyboard (email → @, tel → numbers).
Interactive Practice
Practice: Forms & Inputs
Try the examples in your editor and check off when done.
0% complete
✓
Practice complete!
Great — take the quiz to unlock the next lesson.
Quiz
Test Your Understanding
1. Why pair <label> with input?
2. Which validates email format?