# Javascript: Paragraph.getListNumberText Method

> Gets the paragraph's list number text. The text consists of the text in front of the number, the number itself and the text behind the list number. It is an empty string, if the paragraph does not belong to a numbered list.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: Paragraph.getListNumberText Method
- **491 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraph/getlistnumbertext-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraph/getlistnumbertext-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraph/getlistnumbertext-method/llms-full.txt

---

### Description

Gets the paragraph's list number text. The text consists of the text in front of the number, the number itself and the text behind the list number. It is an empty string, if the paragraph does not belong to a numbered list.

### Syntax

```javascript
<void> Paragraph.getListNumberText(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the paragraph's list number text. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Paragraph.getListNumberText` in a practical document-editing workflow. It gets the paragraph's list number text. The text consists of the text in front of the number, the number itself and the text behind the list number. It is an empty string, if the paragraph does not belong to a numbered list.

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

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

---

## Nearby

- **Previous:** [Javascript: Paragraph.getListNumber Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraph/getlistnumber-method/llms-full.txt)
- **Next:** [Javascript: Paragraph.getStart Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraph/getstart-method/llms-full.txt)
