Element: ariaLabel 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 ariaLabel-Eigenschaft des Element-Interfaces spiegelt den Wert des aria-label-Attributs wider, das eine Zeichenkette definiert, die das aktuelle Element beschreibt.

Wert

Eine Zeichenkette oder null.

Beispiele

In diesem Beispiel wird das aria-label-Attribut des Elements mit der ID close-button auf "Close" gesetzt. Mit ariaLabel aktualisieren wir den Wert auf "Close dialog".

html
<button aria-label="Close" id="close-button">X</button>
js
let el = document.getElementById("close-button");
console.log(el.ariaLabel); // "Close"
el.ariaLabel = "Close dialog";
console.log(el.ariaLabel); // "Close dialog"

Spezifikationen

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

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
ariaLabel

Legend

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

Full support
Full support