Element: ariaMultiLine プロパティ

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.

ariaMultiLineElement インターフェイスのプロパティで、テキストボックスが複数行の入力を受け入れるか単一の行だけを受け入れるかを示す aria-multiline 属性の値を反映します。

メモ: 可能であれば、HTMLの <input> 要素で type="text" を使用するか、<textarea> を使用してください。これらは意味づけが組み込まれており、ARIA 属性を必要としないからです。

以下のいずれかの値を持つ文字列です。

"true"

これは複数行テキストボックスです。

"false"

これは単一行テキストボックスです。

この例では、txtBoxInput という ID を持つ要素の aria-multiline 属性は "true" に設定されており、このボックスが複数行の入力を許可していることを示しています。ariaMultiLine を使用して、値を "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"

仕様書

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

ブラウザーの互換性

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

関連情報