HTMLTextAreaElement: rows property - Web APIs | MDN

Value

A positive integer. Defaults to 2.

Examples

js

const textareaElement = document.getElementById("comment");
const textLines = textArea.rows;
textArea.rows = textLines + 2;

Specifications

Specification
HTML
# dom-textarea-rows

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.