# TextPastedCallback Function

> Callback function for the textPasted event.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Function
- **Introduced:** 23.0
- **Path:** DS Server > Reference > JavaScript API > TextPastedCallback Function
- **162 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textpastedcallback/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textpastedcallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textpastedcallback/llms-full.txt

---

### Description

Callback function for the [textPasted event](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/addeventlistener-method/llms-full.txt).

### Syntax

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

### Examples

The following example demonstrates `TextPastedCallback` in a practical document-editing workflow. Callback function for the textPasted event.

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

---

## Nearby

- **Previous:** [Javascript: TextPartCollection.getMainText Method](https://docs.textcontrol.com/ds-server/reference/javascript/textpartcollection/getmaintext-method/llms-full.txt)
- **Next:** [TextPastedEventArgs Object](https://docs.textcontrol.com/ds-server/reference/javascript/textpastedeventargs/llms-full.txt)
