# HypertextLinkCollection Object

> The HypertextLinkCollection object contains all hypertext links in a Text Control document.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > HypertextLinkCollection Object
- **688 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/llms-full.txt

---

### Description

The HypertextLinkCollection object contains all [hypertext links](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlink/llms-full.txt) in a Text Control document.

### Syntax

```javascript
HypertextLinkCollection
```

### Examples

The following example demonstrates `HypertextLinkCollection` in a practical document-editing workflow. The HypertextLinkCollection object contains all hypertext links in a Text Control document.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const hypertextLinks = mainText.hypertextLinks;
    hypertextLinks.getItem(
        function(result) {
            if (!result) {
                console.warn("No hypertext link was returned.");
                return;
            }
            
            console.log("get item result:", result);
        },
        onTxError,
        25
    );
}, onTxError);
```

---

## In This Section

- [Javascript: HypertextLinkCollection.add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/add-method/llms-full.txt): Inserts a new hypertext link at the current input position.
- [Javascript: HypertextLinkCollection.getItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/getitem-method/llms-full.txt): Gets the hypertext link with the specified id.
- [Javascript: HypertextLinkCollection.remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/remove-method/llms-full.txt): Removes a hypertext link from a Text Control document.

---

## Nearby

- **Previous:** [HypertextLinkClickedCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkclickedcallback/llms-full.txt)
- **Next:** [Javascript: HypertextLinkCollection.add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/hypertextlinkcollection/add-method/llms-full.txt)
