Firefox Tomorrow

web api instance property

HTMLTextAreaElement: rows property

View on MDN ↗

The rows property of the HTMLTextAreaElement interface is a positive integer representing the visible text lines of the text control. It reflects the <textarea> element’s rows attribute.

Value

A positive integer. Defaults to 2.

Examples

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also