Textarea for Multi-line Input
Collect multi-line text with the textarea element.
The textarea Element
The <textarea> element accepts multi-line text input:
<label for="message">Message</label>
<textarea
id="message"
name="message"
rows="5"
cols="40"
placeholder="Enter your message here..."
></textarea>
<!-- textarea is NOT a void element -- it has a closing tag -->
<!-- Default content goes between the tags, not in a value attribute -->rows and cols Attributes
rows and cols set the initial visible size:
<!-- rows: height in lines (default: 2) -->
<!-- cols: width in characters (default: 20) -->
<textarea rows="6" cols="50">...</textarea>
<!-- Better: use CSS for sizing -->
<textarea style="width: 100%; height: 150px; resize: vertical;">All lessons in this course
- Select and option Dropdown Menus
- Textarea for Multi-line Input
- Checkbox and Radio Button Groups
- Datalist for Autocomplete