--- title: Document.dir slug: Web/API/Document/dir tags: - API - Document - HTML DOM - Reference - プロパティ translation_of: Web/API/Document/dir --- <div>{{ApiRef("HTML DOM")}}</div> <p><code><strong>Document.dir</strong></code> プロパティは {{domxref("DOMString")}} で、文書のテキストの書字方向が、左書き (既定) か右書きかを表します。有効な値は <code>'rtl'</code> 右書き (右から左)、または <code>'ltr'</code> 左書き (左から右) です。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox"><em>dirStr</em> = <em>document</em>.dir <em>document</em>.dir = <em>dirStr</em> </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("HTML WHATWG", "#dom-document-dir", "Document.dir")}}</td> <td>{{Spec2("HTML WHATWG")}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("api.Document.dir")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li><a href="/ja/docs/Web/HTML/Global_attributes/dir"><code>dir</code></a> グローバル属性</li> </ul>