# Javascript: InputFormat.getStyleNames Method

> Returns an array of the names of all formatting styles, the document contains.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: InputFormat.getStyleNames Method
- **314 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getstylenames-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getstylenames-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getstylenames-method/llms-full.txt

---

### Description

Returns an array of the names of all formatting styles, the document contains.

### Syntax

```javascript
<void> InputFormat.getStyleNames(<RequestStringsCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives an array of the names of all formatting styles, the document contains. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `InputFormat.getStyleNames` in a practical document-editing workflow. It returns an array of the names of all formatting styles, the document contains.

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

TXTextControl.inputFormat.getStyleNames(
    function(result) {
        console.log("get style names result:", result);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: InputFormat.getStyleName Method](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getstylename-method/llms-full.txt)
- **Next:** [Javascript: InputFormat.getSubscript Method](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsubscript-method/llms-full.txt)
