Text area: If you want the user to enter more than one line of text, you can define a text area instead of using just a regular text field.
<form>
Comments or suggestions: <textarea></textarea>
</form>
Attributes: If you wanted to adjust the size of the text box, you add two additional attributes:
- rows : the rows attribute adjusts the visible height of the textarea.
- cols : the cols attribute adjust the visible width of the textarea.
Note:
- If the character width becomes longer (as the user types the data) than the size of the text area, scrollbar(s) should appear automatically.
- Let’s define a text area of 3 rows (in other words, 3 lines) and 50 cols (in other words, 50 characters per line):
<form>
<textarea rows="3" cols="50"></textarea>
</form>