• Skip to main content
  • Skip to search
  • Skip to select language
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. Document
  4. Document.dir
  • Change language

Table of contents

  • Value
  • Specifications
  • Browser compatibility
  • See also

Document.dir

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.

Value

A string.

Specifications

Specification
HTML Standard
# dom-document-dir

Browser compatibility

BCD tables only load in the browser

See also

  • dir global attribute

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Mar 28, 2022, by MDN contributors

Change your language

Related Topics

  1. HTML DOM API
  2. Document
  3. Constructor
    1. Document()
  4. Properties
    1. activeElement
    2. alinkColor
    3. all
    4. anchors
    5. applets
    6. bgColor
    7. body
    8. characterSet
    9. childElementCount
    10. children
    11. compatMode
    12. contentType
    13. currentScript
    14. defaultView
    15. designMode
    16. dir
    17. doctype
    18. documentElement
    19. documentURI
    20. domain
    21. embeds
    22. fgColor
    23. firstElementChild
    24. forms
    25. fullscreen
    26. fullscreenElement
    27. fullscreenEnabled
    28. head
    29. height
    30. hidden
    31. images
    32. implementation
    33. lastElementChild
    34. lastModified
    35. lastStyleSheetSet
    36. linkColor
    37. links
    38. location
    39. mozSyntheticDocument
    40. onoffline
    41. ononline
    42. origin
    43. pictureInPictureElement
    44. pictureInPictureEnabled
    45. plugins
    46. pointerLockElement
    47. preferredStyleSheetSet
    48. readyState
    49. referrer
    50. rootElement
    51. scripts
    52. scrollingElement
    53. selectedStyleSheetSet
    54. styleSheets
    55. styleSheetSets
    56. timeline
    57. title
    58. URL
    59. visibilityState
    60. vlinkColor
    61. width
    62. xmlEncoding
    63. xmlVersion
  5. Methods
    1. adoptNode()
    2. append()
    3. caretPositionFromPoint()
    4. caretRangeFromPoint()
    5. clear()
    6. close()
    7. createAttribute()
    8. createCDATASection()
    9. createComment()
    10. createDocumentFragment()
    11. createElement()
    12. createElementNS()
    13. createEntityReference()
    14. createEvent()
    15. createExpression()
    16. createNodeIterator()
    17. createNSResolver()
    18. createProcessingInstruction()
    19. createRange()
    20. createTextNode()
    21. createTouch()
    22. createTouchList()
    23. createTreeWalker()
    24. elementFromPoint()
    25. elementsFromPoint()
    26. enableStyleSheetsForSet()
    27. evaluate()
    28. execCommand()
    29. exitFullscreen()
    30. exitPictureInPicture()
    31. exitPointerLock()
    32. getAnimations()
    33. getBoxObjectFor()
    34. getElementById()
    35. getElementsByClassName()
    36. getElementsByName()
    37. getElementsByTagName()
    38. getElementsByTagNameNS()
    39. getSelection()
    40. hasFocus()
    41. hasStorageAccess()
    42. importNode()
    43. mozSetImageElement()
    44. open()
    45. prepend()
    46. queryCommandEnabled()
    47. queryCommandSupported()
    48. querySelector()
    49. querySelectorAll()
    50. registerElement()
    51. releaseCapture()
    52. replaceChildren()
    53. requestStorageAccess()
    54. write()
    55. writeln()
  6. Events
    1. afterscriptexecute
    2. animationcancel
    3. animationend
    4. animationiteration
    5. animationstart
    6. beforescriptexecute
    7. copy
    8. cut
    9. DOMContentLoaded
    10. drag
    11. dragend
    12. dragenter
    13. dragleave
    14. dragover
    15. dragstart
    16. drop
    17. fullscreenchange
    18. fullscreenerror
    19. gotpointercapture
    20. keydown
    21. keypress
    22. keyup
    23. lostpointercapture
    24. paste
    25. pointercancel
    26. pointerdown
    27. pointerenter
    28. pointerleave
    29. pointerlockchange
    30. pointerlockerror
    31. pointermove
    32. pointerout
    33. pointerover
    34. pointerup
    35. readystatechange
    36. scroll
    37. selectionchange
    38. selectstart
    39. touchcancel
    40. touchend
    41. touchmove
    42. touchstart
    43. transitioncancel
    44. transitionend
    45. transitionrun
    46. transitionstart
    47. visibilitychange
    48. wheel
  7. Inheritance:
    1. Node
    2. EventTarget
  8. Related pages for HTML DOM
    1. BeforeUnloadEvent
    2. DOMStringMap
    3. ErrorEvent
    4. GlobalEventHandlers
    5. HTMLAnchorElement
    6. HTMLAreaElement
    7. HTMLAudioElement
    8. HTMLBRElement
    9. HTMLBaseElement
    10. HTMLBaseFontElement
    11. HTMLBodyElement
    12. HTMLButtonElement
    13. HTMLCanvasElement
    14. HTMLContentElement
    15. HTMLDListElement
    16. HTMLDataElement
    17. HTMLDataListElement
    18. HTMLDialogElement
    19. HTMLDivElement
    20. HTMLDocument
    21. HTMLElement
    22. HTMLEmbedElement
    23. HTMLFieldSetElement
    24. HTMLFormControlsCollection
    25. HTMLFormElement
    26. HTMLFrameSetElement
    27. HTMLHRElement
    28. HTMLHeadElement
    29. HTMLHeadingElement
    30. HTMLHtmlElement
    31. HTMLIFrameElement
    32. HTMLImageElement
    33. HTMLInputElement
    34. HTMLKeygenElement
    35. HTMLLIElement
    36. HTMLLabelElement
    37. HTMLLegendElement
    38. HTMLLinkElement
    39. HTMLMapElement
    40. HTMLMediaElement
    41. HTMLMetaElement
    42. HTMLMeterElement
    43. HTMLModElement
    44. HTMLOListElement
    45. HTMLObjectElement
    46. HTMLOptGroupElement
    47. HTMLOptionElement
    48. HTMLOptionsCollection
    49. HTMLOutputElement
    50. HTMLParagraphElement
    51. HTMLParamElement
    52. HTMLPictureElement
    53. HTMLPreElement
    54. HTMLProgressElement
    55. HTMLQuoteElement
    56. HTMLScriptElement
    57. HTMLSelectElement
    58. HTMLShadowElement
    59. HTMLSourceElement
    60. HTMLSpanElement
    61. HTMLStyleElement
    62. HTMLTableCaptionElement
    63. HTMLTableCellElement
    64. HTMLTableColElement
    65. HTMLTableDataCellElement
    66. HTMLTableElement
    67. HTMLTableHeaderCellElement
    68. HTMLTableRowElement
    69. HTMLTableSectionElement
    70. HTMLTemplateElement
    71. HTMLTextAreaElement
    72. HTMLTimeElement
    73. HTMLTitleElement
    74. HTMLTrackElement
    75. HTMLUListElement
    76. HTMLUnknownElement
    77. HTMLVideoElement
    78. HashChangeEvent
    79. History
    80. ImageData
    81. Location
    82. MessageChannel
    83. MessageEvent
    84. MessagePort
    85. Navigator
    86. PageTransitionEvent
    87. Plugin
    88. PluginArray
    89. PopStateEvent
    90. PromiseRejectionEvent
    91. RadioNodeList
    92. ValidityState
    93. Window
    94. WindowEventHandlers
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2022 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies