# Javascript: FormattingStyleCollection.remove Method

> Removes a formatting style from the collection.

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

---

### Description

Removes a formatting style from the collection.

### Syntax

```javascript
<void> FormattingStyleCollection.remove(<string> styleName, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| styleName | The name of the style to remove. |
| callback | Optional. Receives true if the style could be removed, false if not. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FormattingStyleCollection.remove` in a practical document-editing workflow. It removes a formatting style from the collection.

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

function remove(formattingStyles) {
    formattingStyles.remove(
        "Heading 1",
        function(result) {
            if (result) {
                console.log("remove is available.");
            } else {
                console.warn("remove is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [FormattingStyleCollection Object](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstylecollection/llms-full.txt)
- **Next:** [FormField Object](https://docs.textcontrol.com/ds-server/reference/javascript/formfield/llms-full.txt)
