# Javascript: TextField.getHighlightColor Method

> Gets the highlight color for the text field.

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

---

### Description

Gets the highlight color for the text field.

### Syntax

```javascript
<void> TextField.getHighlightColor(<RequestColorStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the highlight color for the text field. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TextField.getHighlightColor` in a practical document-editing workflow. It gets the highlight color for the text field.

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

function inspectHighlightColor(textField) {
    textField.getHighlightColor(
        function(color) {
            console.log("get highlight color result:", color);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TextField.getFormattingBounds Method](https://docs.textcontrol.com/ds-server/reference/javascript/textfield/getformattingbounds-method/llms-full.txt)
- **Next:** [Javascript: TextField.getHighlightMode Method](https://docs.textcontrol.com/ds-server/reference/javascript/textfield/gethighlightmode-method/llms-full.txt)
