# Javascript: TextPart.index Property

> Obsolete. This property will be removed in one of the next versions. The 0-based index of the text part.

> **Note:** This is deprecated and should not be used in new work.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 24.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TextPart.index Property
- **234 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textpart/index-property/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textpart/index-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textpart/index-property/llms-full.txt

---

### Description

`Obsolete. This property will be removed in one of the next versions.` The 0-based index of the text part.

### Syntax

```javascript
<number> TextPart.index
```

### Examples

The following example demonstrates `TextPart.index` in a practical document-editing workflow. Obsolete. This property will be removed in one of the next versions. The 0-based index of the text part.

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

TXTextControl.textParts.getMainText(function(textPart) {
    const index = textPart.index;
    console.log("index:", index);
}, onTxError);
```

### Limitations

Read Only.

---

## Nearby

- **Previous:** [Javascript: TextPart.getTextFields Method](https://docs.textcontrol.com/ds-server/reference/javascript/textpart/gettextfields-method/llms-full.txt)
- **Next:** [Javascript: TextPart.removeSubTextPart Method](https://docs.textcontrol.com/ds-server/reference/javascript/textpart/removesubtextpart-method/llms-full.txt)
