--- title: Document.dir slug: Web/API/Document/dir tags: - API - Document - Property translation_of: Web/API/Document/dir ---
{{ApiRef("")}}
Свойство Document.dir является строкой {{domxref("DOMString")}} показывает направление текста на странице (слева направо или справа налево).
Возможные значения:
'ltr' - слева направо'rtl' - справа налево
dirStr = document.dir; document.dir = dirStr;
| Спецификация | Статус | Комментарий |
|---|---|---|
| {{SpecName("HTML WHATWG", "dom.html#the-dir-attribute:dom-dir", "Document.dir")}} | {{Spec2("HTML WHATWG")}} |
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-dataand send us a pull request.
{{Compat("api.Document.dir")}}