# Javascript: FootnoteCollection.add Method

> Adds a new footnote with the given text to the document at the current input position. A footnote consists of a reference mark in the document and the footnote itself appearing at the bottom of the page.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 32.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FootnoteCollection.add Method
- **504 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/footnotecollection/add-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/footnotecollection/add-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/footnotecollection/add-method/llms-full.txt

---

### Description

Adds a new footnote with the given text to the document at the current input position. A footnote consists of a reference mark in the document and the footnote itself appearing at the bottom of the page.

### Syntax

```javascript
<void> FootnoteCollection.add(<string> text, <string> name, <number> id, <AddFootnoteCallback> callback, <ErrorCallback> errorCallback)
```

### Parameters

| Parameter | Description |
|---|---|
| text | The footnote's text. |
| name | The footnote's name. Set this to null or an empty string to not set a name. |
| id | The footnote's numerical id. Set this to null or 0 to not set an id. |
| callback | The callback function that receives the added footnote. |
| errorCallback | Is called when the operation failed with an error. |

### Examples

The following example inserts a named footnote and reads its assigned document number.

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

TXTextControl.footnotes.add("Reviewed against the 2026 policy.", "PolicyNote", 25, function(response) {
    if (!response.added || !response.footnote) {
        console.warn("The footnote could not be inserted at the current input position.");
        return;
    }

    response.footnote.getNumber(function(number) {
        console.log("Policy footnote number:", number);
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [FootnoteCollection Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/footnotecollection/llms-full.txt)
- **Next:** [Javascript: FootnoteCollection.getDefaultFootnoteHighlightColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/footnotecollection/getdefaultfootnotehighlightcolor-method/llms-full.txt)
