HTML textarea Tag rows Attribute Tutorial

In this section, we will learn what the rows attribute is and how to use it.

What is rows Attribute in HTML <textarea> Tag?

The rows attribute is used to set the visible height of a textarea field. If the value of this attribute is set to 50 for example, that means the height of the field should be wide enough that users be able to see at least 50 characters without any need to scroll up or down.

Note: there’s another attribute called cols that is in charge of controlling the width of the target textarea. You can check the cols attribute section if you want to learn more about this attribute.

HTML rows Attribute in <textarea> Tag Syntax:

<textarea rows = “value”> </textarea>

<textarea> Tag rows Attribute Values

The value set for the rows attribute declares the height of the target textarea in a number of visible characters without the need of scrolling.

Example: using rows attribute in HTML <textarea> tag

See the Pen using rows attribute in HTML <textarea> tag by Omid Dehghan (@odehghan) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies