# Javascript: FormattedText.documentLinks Property

> Gets a collection of all links which point to targets in the same document.

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

---

### Description

Gets a collection of all links which point to targets in the same document.

### Syntax

```javascript
<DocumentLinkCollection> FormattedText.documentLinks
```

### Examples

The following example demonstrates `FormattedText.documentLinks` in a practical document-editing workflow. It gets a collection of all links which point to targets in the same document.

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

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

### Limitations

Read Only.

---

## Nearby

- **Previous:** [Javascript: FormattedText.comments Property](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/comments-property/llms-full.txt)
- **Next:** [Javascript: FormattedText.documentTargets Property](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/documenttargets-property/llms-full.txt)
