HypertextLinkCollection Object
Description
The HypertextLinkCollection object contains all hypertext links in a Text Control document.
Syntax
HypertextLinkCollectionExamples
The following example demonstrates HypertextLinkCollection in a practical document-editing workflow. The HypertextLinkCollection object contains all hypertext links in a Text Control document.
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);Members
Methods
| Method | Description |
|---|---|
| add | Inserts a new hypertext link at the current input position. |
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItem | Gets the hypertext link with the specified id. |
| remove | Removes a hypertext link from a Text Control document. |