# Javascript: TXTextControl.getCommentHighlightMode Method

> Gets the global comment highlight mode.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.getCommentHighlightMode Method
- **349 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcommenthighlightmode-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcommenthighlightmode-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcommenthighlightmode-method/llms-full.txt

---

### Description

Gets the global comment highlight mode.

### Syntax

```javascript
<void> TXTextControl.getCommentHighlightMode(<RequestHighlightModeCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.getCommentHighlightMode` in a practical document-editing workflow. It gets the global comment highlight mode.

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

TXTextControl.getCommentHighlightMode(
    function(result) {
        if (!result) {
            console.warn("No highlight mode was returned.");
            return;
        }
        
        console.log("get comment highlight mode result:", result);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.getCanUndo Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanundo-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.getControlChars Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcontrolchars-method/llms-full.txt)
