# Javascript: FormattedText.tablesOfContents Property

> Gets the current tables of contents.

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

---

### Description

Gets the current tables of contents.

### Syntax

```javascript
<TableOfContentsCollection> FormattedText.tablesOfContents
```

### Examples

The following example demonstrates `FormattedText.tablesOfContents` in a practical document-editing workflow. It gets the current tables of contents.

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

TXTextControl.textParts.getMainText(function(formattedText) {
    formattedText.tablesOfContents.getCount(function(count) {
        console.log("tables of contents count:", count);
    }, onTxError);
}, onTxError);
```

### Limitations

Read Only.

---

## Nearby

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