# Javascript: FormattedText.documentTargets Property

> Gets a collection of all document targets.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FormattedText.documentTargets Property
- **236 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/documenttargets-property/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/documenttargets-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/documenttargets-property/llms-full.txt

---

### Description

Gets a collection of all document targets.

### Syntax

```javascript
<DocumentTargetCollection> FormattedText.documentTargets
```

### Examples

The following example demonstrates `FormattedText.documentTargets` in a practical document-editing workflow. It gets a collection of all document targets.

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

TXTextControl.textParts.getMainText(function(formattedText) {
    formattedText.documentTargets.getCount(function(count) {
        console.log("document targets count:", count);
    }, onTxError);
}, onTxError);
```

### Limitations

Read Only.

---

## Nearby

- **Previous:** [Javascript: FormattedText.documentLinks Property](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/documentlinks-property/llms-full.txt)
- **Next:** [Javascript: FormattedText.editableRegions Property](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/editableregions-property/llms-full.txt)
