Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Accessibility
  3. ARIA
  4. ARIA reference
  5. Attributes
  6. aria-multiline

ARIA: aria-multiline attribute

Thearia-multiline attribute indicates whether atextbox accepts multiple lines of input or only a single line.

Description

The default behavior of theEnter orReturn key differs between single-line and multi-line text fields. When user focus is in a single-line<input type="text">, anEnter orReturn keystroke usually submits the form.

When user focus is in a multi-line<textarea>, the keystroke inserts a line break. Only relevant for elements with thetextbox role set, thearia-multiline attribute indicates to assistive technologies whether that text box accepts multiple lines of input or only a single line, setting expectations as to what type of data to enter and what those keystroke will do.

Note:Where possible, use the HTML<input> or the<textarea>, as these have built in semantics and behaviors, do not require ARIA attributes or scripting, and have keyboard support built in.

If thearia-multiline="true" is set, it means the textbox widget will accept line breaks within the input, similar to the HTML<textarea>. Elements with a role oftextbox that do not have the attribute, or with the value set tofalse, are simple text boxes.

Be aware of focus and keystrokes when designing text boxes. ARIA only modifies the accessibility tree and therefore how assistive technology presents the textbox to your users. ARIA doesn't change anything about an element's default function or behavior. When not using semantic HTML elements for their intended purpose and default functionality, you must use JavaScript to manage behavior and functionality, including responding to keystroke events.

Values

true

The text box accepts multiple lines of input.

false

The text box only accepts a single line of input.

Associated interfaces

Element.ariaMultiLine

TheariaMultiLine property, part of theElement interface, reflects the value of thearia-multiline attribute.

ElementInternals.ariaMultiLine

TheariaMultiLine property, part of theElementInternals interface, reflects the value of thearia-multiline attribute.

Associated roles

Used in roles:

Inherits into roles:

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# aria-multiline

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp