Element.ariaOrientation is an instance property that reflects the aria-orientation attribute. Learn the horizontal, vertical, and undefined tokens, how sliders and similar widgets use orientation for keyboard navigation, and how to get or set the property from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String
03
Values
horizontal · vertical · undefined
04
Reflects
aria-orientation
05
Status
Baseline widely
06
Common with
role="slider"
Fundamentals
Introduction
Sliders, scrollbars, menus, and separators can run horizontally or vertically. Assistive technologies need to know which axis matters so users know which arrow keys to expect.
aria-orientation carries that signal on the widget. ariaOrientation is the JavaScript reflection of that attribute.
JavaScript
const el = document.getElementById("handle_zoomSlider");
console.log(el.ariaOrientation); // "vertical"
el.ariaOrientation = "horizontal";
💡
Beginner tip
Match ariaOrientation to your visual layout and keyboard behavior. A vertical slider should use "vertical" and respond to Up/Down arrows; a horizontal slider uses "horizontal" and Left/Right. Use "undefined" only when orientation is truly unknown or ambiguous.
Concept
Understanding the Property
MDN: the ariaOrientation property of the Element interface reflects the value of the aria-orientation attribute, which indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.
Reflected attribute — mirrors aria-orientation.
Get / set — readable and writable string.
Three tokens — horizontal, vertical, undefined.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaOrientation
Value
A string with one of the following values:
Value
Meaning (MDN)
"horizontal"
The element is horizontal.
"vertical"
The element is vertical.
"undefined"
The element’s orientation is unknown or ambiguous.
⚠️
Keyboard alignment
Set ariaOrientation on the widget (for example a role="slider"). Implement arrow-key handlers that match horizontal vs vertical so behavior matches what assistive technologies announce.
Pattern
📋 MDN Example Shape
MDN starts with a vertical slider, then updates orientation to "horizontal":
Element.ariaOrientation is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
Internet ExplorerNo ariaOrientation IDL — use setAttribute
No
ariaOrientationBaseline
Bottom line: Use ariaOrientation on sliders and similar widgets to declare axis. Match arrow-key behavior to horizontal vs vertical. Prefer native range inputs when you can.
Wrap Up
Conclusion
ariaOrientation reflects aria-orientation so widgets can declare whether they run horizontally or vertically. Prefer native range inputs when possible, match arrow-key behavior to the token, and use "undefined" only when orientation is truly ambiguous.
Claim vertical orientation while only Left/Right work
Put aria-orientation on every child item
Skip focusability on custom sliders
Forget to update orientation when layout changes
Assume the property alone handles value changes
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaOrientation
Reflected aria-orientation string for horizontal and vertical widgets.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
horizontal / vertical / undefined
three tokens
Values
🔍03
On widget
slider, scrollbar
Where
✅04
Baseline
widely available
Status
🎯05
Arrow keys
match axis
Pair
❓ 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.
Did you know?
Roles like slider, scrollbar, and separator often use aria-orientation. The attribute answers “which axis does keyboard navigation follow?”—your arrow-key handlers should match that answer.