Get Document Direction
Get the document direction (ltr or rtl) based on the current document.
Category | Accessibility |
Author | Pol Gubau |
Since | 1.0.0 |
Last Updated | 2025-03-15 |
Type | Sync |
Compatibility | Browser |
Example
Input
getDocumentDirection()
Output:
"ltr"
Return
The document direction (ltr or rtl).
Type: enum
- Options:
- ltr
- rtl
Notes
This function requires a browser environment with a valid document object.
Tags
- accessibility
- document
- direction