Is there an input with Type textarea?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *