# Javascript: Selection.getBold Method

> Gets the bold attribute of the selected text.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: Selection.getBold Method
- **345 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getbold-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getbold-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getbold-method/llms-full.txt

---

### Description

Gets the bold attribute of the selected text.

### Syntax

```javascript
<void> Selection.getBold(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the bold attribute of the selected text. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Selection.getBold` in a practical document-editing workflow. It gets the bold attribute of the selected text.

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

TXTextControl.selection.getBold(
    function(result) {
        if (result) {
            console.log("get bold is available.");
        } else {
            console.warn("get bold is not available in the current document state.");
        }
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: Selection.getBaseline Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getbaseline-method/llms-full.txt)
- **Next:** [Javascript: Selection.getCapitals Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getcapitals-method/llms-full.txt)
