# Javascript: FrameBase.getAlignment Method

> Gets the frame's horizontal alignment when it is anchored to a paragraph.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FrameBase.getAlignment Method
- **393 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getalignment-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getalignment-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getalignment-method/llms-full.txt

---

### Description

Gets the frame's horizontal alignment when it is anchored to a paragraph.

### Syntax

```javascript
<void> FrameBase.getAlignment(<RequestHorizontalAlignmentCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FrameBase.getAlignment` in a practical document-editing workflow. It gets the frame's horizontal alignment when it is anchored to a paragraph.

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

function inspectAlignment(frameBase) {
    frameBase.getAlignment(
        function(alignment) {
            if (!alignment) {
                console.warn("No horizontal alignment was returned.");
                return;
            }
            
            console.log("get alignment result:", alignment);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FrameBase.changeZOrder Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/changezorder-method/llms-full.txt)
- **Next:** [Javascript: FrameBase.getBounds Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getbounds-method/llms-full.txt)
