# Javascript: TXTextControl.headersAndFooters Property

> Gets a collection of all headers and footers in the document.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TXTextControl.headersAndFooters Property
- **213 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/headersandfooters-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/headersandfooters-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/headersandfooters-property/llms-full.txt

---

### Description

Gets a collection of all headers and footers in the document.

### Syntax

```javascript
<HeaderFooterCollection> TXTextControl.headersAndFooters
```

### Examples

The following example demonstrates `TXTextControl.headersAndFooters` in a practical document-editing workflow. It gets a collection of all headers and footers in the document.

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

tXTextControl.headersAndFooters.getCount(function(count) {
    console.log("headers and footers count:", count);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.HeaderFooterType Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/headerfootertype-enumeration/llms-full.txt)
- **Next:** [Javascript: TXTextControl.HighlightMode Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/highlightmode-enumeration/llms-full.txt)
