# Javascript: TXTextControl.Direction Enumeration

> Determines the writing direction of a paragraph.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Enumeration
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.Direction Enumeration
- **311 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/direction-enumeration/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/direction-enumeration/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/direction-enumeration/llms-full.txt

---

### Description

Determines the writing direction of a paragraph.

### Members

| Member | Description |
|---|---|
| LeftToRight | The writing direction is left to right, which means that blocks of text with left to right and right to left characters are ordered from left to right. |
| RightToLeft | The writing direction is right to left, which means that blocks of text with left to right and right to left characters are ordered from right to left. |

### Examples

The following example uses `TXTextControl.Direction.LeftToRight` (the writing direction is left to right, which means that blocks of text with left to right and right to left characters are ordered from left to right.) in a document-editing workflow.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.paragraphFormat.setDirection(
    TXTextControl.Direction.LeftToRight,
    function() {
        console.log("set direction completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.DialogBoxKind Enumeration](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/dialogboxkind-enumeration/llms-full.txt)
- **Next:** [Javascript: TXTextControl.displayColors Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/displaycolors-property/llms-full.txt)
