HTML
Module 10: HTML Forms Fundamentals
Select, Textarea, and Button
Use the right control for a fixed choice, longer response, or user action.
7 minute lessonBeginner to advanced
Not every form field should be an input. A select is useful for a choice from a known set of options, and a textarea is suitable for longer text.
<label for="experience">Experience level</label>
<select id="experience" name="experience">
<option value="">Choose one</option>
<option value="beginner">Beginner</option>
<option value="intermediate">Intermediate</option>
<option value="advanced">Advanced</option>
</select>
<label for="message">What are you building?</label>
<textarea id="message" name="message" rows="5"></textarea>
Use meaningful option values. The visible label is what the visitor reads; the value is what the browser submits.
Buttons have three common types: submit submits the form, reset restores controls to their initial values, and button has no submission behavior by default. Set the type explicitly when the intent matters:
<button type="submit">Send message</button>
<button type="button">Preview</button>
A reset button is rarely appropriate because it can erase a visitor’s work accidentally. Add it only when there is a clear user need.