Skip to main content

The <textarea> Element

As defined in the HTML Living Standard, the <textarea> element represents a multi-line plain text edit control for the element's raw value.

Visual Example:

<label for="story">Tell us your story:</label> <textarea id="story" name="story" rows="5" cols="33"> It was a dark and stormy night... </textarea> View HTML Living Standard: The textarea element

Accessibility Fundamentals

As with all form controls, the <textarea> relies on external elements and attributes to be accessible.

WCAG Requirement: Name, Role, Value

Success Criterion 4.1.2 (Level A): For all user interface components, the name and role can be programmatically determined...

You must associate the textarea with a <label> using the for and id attributes. This ensures the "Name" (the label text) is announced by screen readers when the user enters the control. Without this association, the textarea is an anonymous box to anyone using assistive technology.

Understand SC 4.1.2: Name, Role, Value

Standard Attributes

<textarea id="bio" maxlength="200" required></textarea>

Best Practices

A11y Tip: Character Counters

If using maxlength, consider adding a visible character counter that uses aria-live="polite". This informs users with low vision or cognitive disabilities how much space they have remaining as they type.