JavaScript Element ariaMultiLine Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

In JavaScript, ariaMultiLine reflects the aria-multiline attribute: a string ("true" / "false") that tells assistive technology whether a text box accepts multiple lines or only one (MDN).

Read the notes below before you get or set this property. Prefer feature detection when support is limited.

Syntax

Use el.ariaMultiLine. Start with this line.

JavaScript
element.ariaMultiLine
CallWhat it does
element.ariaMultiLinePrimary signature.

Built into the browser. Read or assign el.ariaMultiLine — no import required.

Library declarations
JavaScript
element.ariaMultiLine

Parameters

ParameterDescription
ValueOptional. "true" or "false"
Enter key handlingRequired. Must match the announced mode
Custom elementsOptional. ElementInternals.ariaMultiLine

Return Value

Return ValueDescription
*The current value of el.ariaMultiLine.

JavaScript Examples

Example 1 — Get and Set (MDN)

Read the current mode, then switch the textbox to single-line.

JavaScript
let el = document.getElementById("txtBoxInput");
console.log(el.ariaMultiLine); // "true"
el.ariaMultiLine = "false";
console.log(el.ariaMultiLine); // "false"
Try It Yourself

How It Works

  1. Select the textbox. It already has aria-multiline="true".
  2. Read ariaMultiLine. Returns the string "true".
  3. Assign "false". Updates the reflected attribute.
  4. Read again. Confirms single-line mode for AT.

Example 2 — Custom role="textbox"

Declare a contenteditable textbox and mark it multi-line.

JavaScript
const box = document.getElementById("editor");
box.setAttribute("role", "textbox");
box.ariaMultiLine = "true";
box.setAttribute("aria-labelledby", "editor-label");
console.log(box.role, box.ariaMultiLine);
Try It Yourself

How It Works

  1. Set the role. textbox identifies an editable field.
  2. Set ariaMultiLine. Tells AT that Enter should insert a line break.
  3. Name the control. Use aria-labelledby (or a visible label).
  4. Handle Enter in JS so behavior matches the announced mode.

Example 3 — Property Reflects the Attribute

Show that ariaMultiLine and aria-multiline stay in sync.

JavaScript
const el = document.getElementById("txtBoxInput");
el.ariaMultiLine = "false";
console.log(el.getAttribute("aria-multiline")); // "false"
el.setAttribute("aria-multiline", "true");
console.log(el.ariaMultiLine); // "true"
Try It Yourself

How It Works

  1. Write via the property. Attribute updates immediately.
  2. Read via getAttribute. Same value as ariaMultiLine.
  3. Write via the attribute. Property reflects the change.
  4. Use string tokens. "true" and "false".

Browser Support

Element.ariaMultiLine is marked Baseline Widely available on MDN (since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.

✓ Baseline · Widely available

Element ariaMultiLine

Reflects aria-multiline — whether a textbox accepts multiple lines.

Widely Available
Google Chrome Full support · Desktop & Mobile
Full support
Mozilla Firefox Full support · Desktop & Mobile
Full support
Apple Safari Full support · macOS & iOS
Full support
Microsoft Edge Full support · Chromium
Full support
Opera Full support · Modern versions
Full support
Internet Explorer No Element.ariaMultiLine
Not supported
ariaMultiLine Baseline support

Bottom line: Safe in modern browsers. Prefer textarea/input when you can; use ariaMultiLine on custom role=textbox widgets. See the MDN Element.ariaMultiLine reference.

Frequently Asked Questions

It reflects the aria-multiline attribute as a string, indicating whether a text box accepts multiple lines of input or only a single line.
No. MDN marks Element.ariaMultiLine as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
The strings "true" (multi-line text box) or "false" (single-line text box).
No when you can avoid it. MDN recommends using an HTML input with type="text" or a textarea when possible, because they have built-in semantics and do not require ARIA attributes.
When you build a custom role="textbox" (for example a contenteditable div) and need to tell assistive technologies whether Enter creates a new line or submits.
Yes. Reading and writing ariaMultiLine updates the reflected aria-multiline attribute. Keep the actual keyboard behavior in sync with the value.

Next: Element ariaMultiSelectable

Learn how multi-select widgets expose selection semantics to assistive technology.

ariaMultiSelectable tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful