HTML / Element / Initial coverage

<textarea> Element

Status: Initial coverage Scope: HTML Living Standard Checked: 2026-09-13

Technical Summary

The textarea element is a multiline plain-text edit control. Its contents represent the default value, which is distinct from the current value after user editing or DOM API changes.

textarea is a form-associated, labelable, listed, submittable, and resettable element. Its name, form, disabled state, constraint-validation state, and label association participate in form behavior.

Meaning, categories, and content model

textarea element fundamentals
ItemDefinitionBoundary to check
MeaningA multiline plain-text edit controlIt is not an HTML rich-text editing surface
CategoriesFlow, phrasing, interactive, listed, labelable, submittable, resettable, form-associated, and palpableShared form-control, label, submission, and reset mechanisms apply
Content modelTextIts contents provide the initial value; they are not HTML child elements to be rendered as markup
Tag omissionNeither the start nor end tag is omissibleKeep the closing tag even for an empty control

Unlike a rich-text editor, a native textarea represents plain text. A visual line wrap and a newline inserted into the value submitted by a form are not necessarily the same thing.

Initial value, raw value, and current value

The element's contents represent its default value. When a user edits the control, its raw value changes, and the current API value is exposed through textarea.value. There is no value content attribute for setting a textarea's initial value in the way that input uses one.

<textarea id="note" name="note" rows="3">The initial value</textarea>

<script>
  const note = document.querySelector('#note');
  note.value;        // current value
  note.defaultValue; // reset baseline
</script>
Three views of a textarea value
ConceptMeaningUsed for
Raw valueThe value set on the control before normalizationSpecification state and user editing
API valueThe value with line breaks normalized to LFvalue, textLength, minlength, and maxlength
Form valueThe API value with additional wrap="hard" line breaks when requiredForm submission and related processing

User editing sets the dirty value flag. After that flag is set, changing the DOM child text does not necessarily update the current value in the same way. A form reset clears the flag and sets the raw value from the child text.

Mutability, readonly, and disabled

A textarea is mutable when it is neither disabled nor readonly. A mutable control lets the user edit its raw value, including inserting and removing LF line breaks.

Editing, validation, and submission boundaries
StateEditingConstraint validationForm submission
DefaultEditableParticipates in conditions such as requiredEligible when its submission conditions, including name, are met
readonlyUsers cannot edit, but can read and select the textBarred from constraint validationUnlike disabled, it is not automatically excluded from submission
disabledNot interactiveBarred from constraint validationIts value is not included in form submission

readonly and disabled are not interchangeable presentation flags. Check editing, validation participation, and submission eligibility separately.

Important content attributes

Attributes and conditions
AttributeMeaningCondition or caution
nameName used for the submitted value and form.elementsWithout a name, it normally does not contribute a form-submission entry
formExplicitly sets the form ownerAssociates with a form in the same document
requiredRequires a non-empty valueA mutable textarea with an empty form value is suffering from being missing
minlength / maxlengthLower and upper value-length limitsThe length of the newline-normalized API value is relevant
placeholderShort input hint when the value is emptyIt is not a replacement for a label
rows / colsHints for visible height and character widthDefault rows is 2 and default cols is 20; final presentation also depends on CSS and the user agent
wrapControls wrapping of the submitted valuesoft does not add wrapping newlines on submission; hard does. Hard requires cols
dirnameNames an entry for submitting the control's directionalityIt can create a separate submission entry from the normal value
autocompleteAutofill hintInterpret it together with the shared form-control autocomplete rules
readonly / disabledChange editing, interaction, validation, and submission stateDo not collapse their different consequences into one category

Newline normalization and wrap

A textarea value has three relevant views. The raw value is not normalized. The API value normalizes line breaks to LF (U+000A). The form-submission value starts from the API value and can receive wrapping newlines under wrap="hard".

Wrap stateVisual wrappingSubmitted value
soft (default)The rendering may wrap lines visuallyVisual wrapping alone does not add submitted newlines
hardThe rendering may wrap at the cols widthThe user agent adds wrapping newlines for submission

Therefore, the number of visual lines and the newline positions in a submitted string cannot be assumed to match. When a server processes line breaks, inspect the received value together with the wrap conditions.

Form submission and constraint validation

textarea is a form-associated submittable element. When it has a form owner, is not disabled, and meets conditions such as having a name, its form value contributes to the form's entry list.

<form action="/messages" method="post">
  <label for="body">Body</label>
  <textarea id="body" name="body" required minlength="10"></textarea>
  <button type="submit">Send</button>
</form>

When required is present, the textarea is mutable, and its value is empty, constraint validation reports a missing value. minlength and maxlength constrain value length, while readonly and disabled affect validation participation. Browser validation is not a substitute for server-side validation.

DOM Interface

The textarea element is exposed through HTMLTextAreaElement.

Main HTMLTextAreaElement APIs
APISummary
valueGets or sets the current API value; setting it affects the raw value and dirty value flag
defaultValueGets or sets the initial-value baseline represented by the child text
textLengthReads the length of the API value
selectionStart / selectionEndGets or sets the selection range positions
setSelectionRange()Sets the selection range and direction
setRangeText()Replaces text in a selected range
form / labelsReads the form owner and associated labels
willValidate / validityReads validation participation and current state
checkValidity() / reportValidity()Runs or reports constraint validation
cols / rows / wrapHandles visible-size and submission-wrapping conditions

When user interaction changes the raw value, an input event is fired. Code that handles the event should still distinguish raw value, API value, and the value used for form submission.

Fact / Evidence

The main facts below are paired with their scope, verification state, and normative source. Browser and accessibility-tree observations are kept separate in the Implementation Evidence section.

Major facts and source locations
TypeFactCondition / ScopeStatusSource
SPECThe textarea element is a multiline plain-text edit control, and its contents represent its default value.Meaning and initial state of the textarea element.ReviewedHTML Standard: the textarea element
SPECRaw value, API value, and the value used for form submission differ in newline normalization and wrap processing.LF normalization and submitted value under wrap="hard".ReviewedHTML Standard: value normalization
SPECUser editing sets the dirty value flag, while form reset restores the value from the default-value text.Initial value, DOM changes, user editing, and reset algorithm.ReviewedHTML Standard: textarea reset algorithm
SPECrequired treats an empty value in a mutable textarea as missing, while readonly bars the control from constraint validation.Required, mutability, readonly, and constraint validation.ReviewedHTML Standard: validation conditions
SPECtextarea is a form-associated submittable element; name, form, and disabled affect submission.Form owner, entry list, disabled state, and forms API.ReviewedHTML Standard: form control infrastructure
SPECHTML-AAM maps a native textarea to the textbox role with multiline=true.Native accessible-role mapping.ReviewedHTML-AAM: textarea

Evidence

  1. HTML Standard: The textarea element — meaning, categories, content model, attributes, values, reset, and DOM interface
  2. HTML Standard: Form control infrastructure — form owners, disabled state, constraint validation, and shared submission model
  3. HTML Accessibility API Mappings: textarea — textbox role, multiline state, accessible name, and state mappings
  4. WPT: textarea element tests — tests related to textarea values, attributes, and form behavior
  5. WPT: input events and textarea editing — an example covering editing actions and input events

Implementation Evidence

Browser behavior, WPT results, and accessibility observations are recorded separately from normative claims. Unrun items are not treated as reviewed.

Measured fixture / environment: The fixture contains an initial-value textarea, empty required textarea, minlength and maxlength, readonly, disabled, wrap="hard", an external form owner, and a reset button inside or alongside <form id="evidence-form" method="get">. DOM, ValidityState, and FormData were measured in Chrome 152.0.0.0 (HeadlessChrome / Windows NT 10.0) on 2026-09-13.

textarea element implementation evidence register
TypeReproduction scopeConditions to recordStatus
IMPLInitial value, value, defaultValue, dirty value flag, DOM changes, and form resetMeasured result (Chrome 152.0.0.0 / Windows NT 10.0 / 2026-09-13): child text supplied the same initial value to value, defaultValue, and textContent. Changing value to Edited left defaultValue and textContent unchanged; reset restored the initial valueReviewed
IMPLrequired, minlength, maxlength, readonly, disabled, form owner, and submissionMeasured: empty required produced valid=false and valueMissing=true, while ok was valid. readonly had willValidate=false. The disabled textarea was absent from FormData and the external-form textarea was included. Programmatic value assignment did not set tooShort / tooLong; the user-edit path remains unrunIncomplete
IMPLNewlines, rows, cols, and wrap="soft" / hardMeasured: with wrap="hard", cols=4, and value abcdefghij, FormData contained abcdef\nghij. Visual wrapping, LF / CRLF variants, and changed cols widths were not runIncomplete
WPTTextarea element, initial/current values, attributes, selection, form submission, and input eventsFrom the textarea element tests, ran textarea-type.html, textarea-minlength.html, and textarea-validity-valueMissing-inside-datalist.html, and also checked the input events test. On 2026-09-15 in Chrome 152.0.0.0 / Windows NT 10.0, selected textarea tests passed 7/7; input events passed 0/3 because action_sequence() is not implemented. Remaining directory coverage and other browsers remain open.Partial (7/10 pass)
AAMAccessible name, textbox role, multiline state, and required / readonly / disabled statesObserve a labeled textarea and each state in the accessibility tree and assistive technology; record the environment after measurementPending

Use the WPT repository for test mappings and HTML-AAM for accessibility criteria.

Coverage / Open Issues

  • ReviewedTextarea meaning, categories, content model, initial/current/default values, major attributes, and the HTMLTextAreaElement API overview
  • ReviewedRequired, minlength, maxlength, readonly, disabled, form owner, and major form-submission boundaries
  • ReviewedRaw value, API value, form value, LF normalization, and the basic relationship with wrap
  • OpenAll branches of the form-submission algorithm, entry-list construction, dirname, encoding, and formdata event
  • OpenThe wrap="hard" wrapping algorithm, newline and Unicode edge cases, and implementation differences in value length
  • OpenImplementation evidence, multiple browsers, WPT execution, complete HTML-AAM mapping, assistive-technology observations, compatibility, historical changes, and Expert-gap Review

This is initial coverage. It does not claim that the entire textarea element has been verified, that every browser exposes the same value or presentation, or that assistive technologies produce the same result.

Related surface

For a beginner-friendly explanation of multiline input, labels, initial values, and form submission, see the textarea element page in Yugien. The shared form-submission model is covered by the form element in Atlas; label association by the label element; and boundaries with other form controls by the input, select, and button pages.