In JavaScript, ariaOrientation reflects the aria-orientation attribute: a string that indicates whether a widget is horizontal, vertical, or orientation is undefined / ambiguous (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.ariaOrientation. Start with this line.
JavaScript
element.ariaOrientation
Call
What it does
element.ariaOrientation
Primary signature.
Built into the browser. Read or assign el.ariaOrientation — no import required.
Library declarations
JavaScript
element.ariaOrientation
Parameters
Parameter
Description
Value
Optional. horizontal / vertical / undefined
Arrow-key JS
Required. Must match the orientation
Custom elements
Optional. ElementInternals.ariaOrientation
Return Value
Return Value
Description
*
The current value of el.ariaOrientation.
JavaScript Examples
Example 1 — Get and Set (MDN)
Read the current orientation, then switch the slider to horizontal.
JavaScript
let el = document.getElementById("handle_zoomSlider");
console.log(el.ariaOrientation); // "vertical"
el.ariaOrientation = "horizontal";
console.log(el.ariaOrientation); // "horizontal"
Write via the property. Attribute updates immediately.
Read via getAttribute. Same value as ariaOrientation.
Write via the attribute. Property reflects the change.
Use exact tokens.horizontal, vertical, or undefined.
Compatibility
Browser Support
Element.ariaOrientation 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 ariaOrientation
Reflects aria-orientation — horizontal, vertical, or undefined.
WidelyAvailable
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerNo Element.ariaOrientation
Not supported
ariaOrientationBaseline support
Bottom line: Safe in modern browsers. Pair the announced orientation with matching arrow-key behavior. See the MDN Element.ariaOrientation reference.
Frequently Asked Questions
It reflects the aria-orientation attribute as a string, indicating whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
No. MDN marks Element.ariaOrientation as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
The strings "horizontal" (element is horizontal), "vertical" (element is vertical), or "undefined" (orientation is unknown or ambiguous).
Common examples include slider, scrollbar, separator, listbox, menu, and toolbar. Match the value to how keyboard navigation should work (for example Up/Down on a vertical slider).
MDN sets aria-orientation="vertical" on a role="slider" element, reads "vertical" via ariaOrientation, then assigns "horizontal" to update the reflected attribute.
Yes. Reading and writing ariaOrientation updates the reflected aria-orientation attribute. Keep arrow-key behavior aligned with horizontal vs vertical.