# Javascript: FormattingStyle.setName Method

> Sets the name of the style.

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

---

### Description

Sets the name of the style.

### Syntax

```javascript
<void> FormattingStyle.setName(<String> name, <EmptyRequestCallback> callback)
```

### Parameters

| Parameter | Description |
|---|---|
| name | The name of the style. |
| callback | Is called when the operation completed. |

### Examples

The following example demonstrates `FormattingStyle.setName` in a practical document-editing workflow. It sets the name of the style.

```javascript
function configureName(formattingStyle) {
    formattingStyle.setName(
        "Invoice Heading",
        function() {
            console.log("set name completed.");
        }
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.setItalic Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setitalic-method/llms-full.txt)
- **Next:** [Javascript: FormattingStyle.setStrikeout Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setstrikeout-method/llms-full.txt)
