# CommentEventCallback Function

> Callback function for a comment related event. ("commentChanged", "commentCreated", "commentDeleted", "commentedTextEntered", "commentedTextLeft" and "commentStateChanged") (see also TXTextControl.addEventListener function)

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Function
- **Introduced:** 30.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > CommentEventCallback Function
- **254 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/commenteventcallback/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/commenteventcallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/commenteventcallback/llms-full.txt

---

### Description

Callback function for a comment related event. ("commentChanged", "commentCreated", "commentDeleted", "commentedTextEntered", "commentedTextLeft" and "commentStateChanged") (see also [TXTextControl.addEventListener function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/addeventlistener-method/llms-full.txt))

### Syntax

```javascript
function(<CommentEventArgs> args)
```

### Examples

The following example demonstrates `CommentEventCallback` in a practical document-editing workflow. Callback function for a comment related event. ("commentChanged", "commentCreated", "commentDeleted", "commentedTextEntered", "commentedTextLeft" and "commentStateChanged") (see also TXTextControl.addEventListener function).

```javascript
function commentEventCallback(args) {
    console.log("args:", args);
}
```

---

## Nearby

- **Previous:** [Javascript: CommentEventArgs.commentedText Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/commenteventargs/commentedtext-property/llms-full.txt)
- **Next:** [ComponentSettings Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/componentsettings/llms-full.txt)
