Loading...
HTML Textarea
Single-line input is not enough for comments or messages. Use textarea for multi-line text.
Direct answer
Write <textarea id="msg" name="msg" rows="5"></textarea> and connect a label with for. Default text, if any, goes between the tags (not in a value attribute like input).
Labeled textarea
html
HTML Code
<label for="msg">Message</label>
<textarea id="msg" name="msg" rows="5" cols="40" placeholder="Write your message"></textarea>
Try it
- Add a textarea with at least 4 rows
- Label it correctly
- Pre-fill a short default sentence between the tags
- Style width with CSS if you prefer over
cols
Easy mistakes
- Using
value="…"on textarea (put text between tags instead) - Missing
nameso the message is not submitted - No label for the field
Summary
textarea= multi-line text- Label it; give it a
name - Default text sits between the tags
- Size with rows/cols or CSS
🧠 Test Your Knowledge
Ready to Start
Test Your Knowledge
Challenge yourself with this interactive quiz and see how well you understand the topic
4
Questions
70%
To Pass
∞
Time
∞
Attempts
📝 Instructions
- Read each question carefully
- Select the best answer for each question
- You can retake the quiz as many times as you want
- Your progress will be shown at the top