There isn’t a input with type textarea
.
Instead, we use the textarea
tag to create a text area.
This lets us enter text that has multiple rows and longer than an input
would allow.
For instance, we can write;
<textarea rows="5" cols="50">
to display a text area with 5 rows and 50 columns wide.
We should pair that with a label tag for better accessibility.
We can write:
<label for="diary">Diary:</label>
<textarea id="diary" rows="5" cols="50">
The value of the for
attribute of label
should match with the id
of the textarea
element.
Then everyone including people that rely on screen readers will know what we should enter in the text area.