The Document.dir property is a string representing the directionality of the text of the document, whether left to right (default) or right to left. Possible values are 'rtl', right to left, and 'ltr', left to right.
On this page
Document: dir property
Value
A string.
Specifications
| Specification |
|---|
| HTML Standard # dom-document-dir |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
dir |
64 | 12 |
1Incorrect behavior before Firefox 23. |
5 | 51 | 10.1 | 64 | 64 |
4Incorrect behavior before Firefox 23. |
47 | 10.3 | 9.0 |
See also
dirglobal attribute
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document/dir