Vous lisez la version anglaise de ce contenu car il n’existe pas encore de traduction dans cette langue. Aidez-nous à traduire cet article !
The Document.dir
property is a DOMString
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.
Syntax
dirStr = document.dir; document.dir = dirStr;
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'Document.dir' in that specification. |
Living Standard | Initial specification |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
dir | Chrome
Full support
45
| Edge Full support 12 | Firefox
Full support
Yes
| IE Full support Yes | Opera Full support Yes | Safari Full support Yes | WebView Android
Full support
45
| Chrome Android
Full support
45
| Firefox Android
Full support
Yes
| Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android ? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.
- See implementation notes.