Element: ariaMultiLine-Eigenschaft

Baseline 2023
Newly available

Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Die ariaMultiLine-Eigenschaft des Element-Interfaces spiegelt den Wert des aria-multiline-Attributs wider, das angibt, ob ein Textfeld mehrere Zeilen der Eingabe akzeptiert oder nur eine einzelne Zeile.

Hinweis: Verwenden Sie nach Möglichkeit ein HTML-<input>-Element mit type="text" oder ein <textarea>, da diese eingebaute Semantik haben und keine ARIA-Attribute erfordern.

Wert

Ein String mit einem der folgenden Werte:

"true"

Dies ist ein mehrzeiliges Textfeld.

"false"

Dies ist ein einzeiliges Textfeld.

Beispiele

In diesem Beispiel ist das aria-multiline-Attribut des Elements mit der ID txtBoxInput auf "true" gesetzt, was anzeigt, dass dieses Feld mehrere Zeilen der Eingabe erlaubt. Mit ariaMultiLine aktualisieren wir den Wert auf "false".

html
<div id="txtboxMultilineLabel">Enter the tags for the article</div>
<div
  role="textbox"
  id="txtBoxInput"
  contenteditable="true"
  aria-multiline="true"
  aria-labelledby="txtboxMultilineLabel"
  aria-required="true"></div>
js
let el = document.getElementById("txtBoxInput");
console.log(el.ariaMultiLine); // "true"
el.ariaMultiLine = "false";
console.log(el.ariaMultiLine); // "false"

Spezifikationen

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariamultiline

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ariaMultiLine

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch