# Javascript: FormattingStyle.setUnderline Method

> Sets the underlining styles for the style.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FormattingStyle.setUnderline Method
- **263 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setunderline-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setunderline-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setunderline-method/llms-full.txt

---

### Description

Sets the underlining styles for the style.

### Syntax

```javascript
<void> FormattingStyle.setUnderline(<FontUnderlineStyle> underlineStyle, <EmptyRequestCallback> callback)
```

### Parameters

| Parameter | Description |
|---|---|
| underlineStyle | The underlining styles for the style. |
| callback | Is called when the operation completed. |

### Examples

The following example demonstrates `FormattingStyle.setUnderline` in a practical document-editing workflow. It sets the underlining styles for the style.

```javascript
function configureUnderline(formattingStyle) {
    formattingStyle.setUnderline(
        TXTextControl.FontUnderlineStyle.Single,
        function() {
            console.log("set underline completed.");
        }
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.setTextBackColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/settextbackcolor-method/llms-full.txt)
- **Next:** [FormattingStyleCollection Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstylecollection/llms-full.txt)
