Firefox Tomorrow

web api instance property

HTMLTextAreaElement: cols property

View on MDN ↗

The cols property of the HTMLTextAreaElement interface is a positive integer representing the visible width of the multi-line text control, in average character widths. It reflects the <textarea> element’s cols attribute.

Value

A positive integer. Defaults to 20.

Examples

const textareaElement = document.getElementById("comment");
textArea.cols = 80;

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also