# Javascript: Table.getDescriptiveText Method

> Gets the table's descriptive text. The descriptive text is used by screen readers to describe the table to users with visual impairments. An empty string is returned if no descriptive text is set.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 34.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: Table.getDescriptiveText Method
- **473 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/table/getdescriptivetext-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/table/getdescriptivetext-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/table/getdescriptivetext-method/llms-full.txt

---

### Description

Gets the table's descriptive text. The descriptive text is used by screen readers to describe the table to users with visual impairments. An empty string is returned if no descriptive text is set.

### Syntax

```javascript
<void> Table.getDescriptiveText(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Table.getDescriptiveText` in a practical document-editing workflow. It gets the table's descriptive text. The descriptive text is used by screen readers to describe the table to users with visual impairments. An empty string is returned if no descriptive text is set.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const tables = mainText.tables;
    tables.getItem(function(table) {
        if (!table) {
            console.warn("No table is available at the current input position.");
            return;
        }
    
        table.getDescriptiveText(
            function(result) {
                console.log("get descriptive text result:", result);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: Table.getCanSplitCells Method](https://docs.textcontrol.com/ds-server/reference/javascript/table/getcansplitcells-method/llms-full.txt)
- **Next:** [Javascript: Table.getID Method](https://docs.textcontrol.com/ds-server/reference/javascript/table/getid-method/llms-full.txt)
