# Section Object

> Represents a section of a document. Sections are numbered from the beginning to the end of the document beginning with 1. A document has at least one section. A section is a part of the document that specifies the page size, the page margins and the headers and footers. A section can be obtained from the section collection.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Section Object
- **601 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/llms-full.txt

---

### Description

Represents a section of a document. Sections are numbered from the beginning to the end of the document beginning with 1. A document has at least one section. A section is a part of the document that specifies the page size, the page margins and the headers and footers. A section can be obtained from the [section collection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/sectioncollection/llms-full.txt).

### Syntax

```javascript
Section
```

### Examples

The following example demonstrates `Section` in a practical document-editing workflow. It represents a section of a document. Sections are numbered from the beginning to the end of the document beginning with 1. A document has at least one section. A section is a part of the document that specifies the page size, the page margins and the headers and footers. A section can be obtained from the section collection.

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

function inspectSection(section) {
    section.getLength(
        function(result) {
            console.log("get length result:", result);
        },
        onTxError
    );
}
```

---

## In This Section

- [Javascript: Section.format Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/format-property/llms-full.txt): The section's formatting attributes.
- [Javascript: Section.getLength Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/getlength-method/llms-full.txt): Gets the number of characters in the section.
- [Javascript: Section.getNumber Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/getnumber-method/llms-full.txt): Gets the section's number.
- [Javascript: Section.getStart Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/getstart-method/llms-full.txt): Gets the number (one-based) of the first character in the section.
- [Javascript: Section.headersAndFooters Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/headersandfooters-property/llms-full.txt): The section's headers and footers.
- [Javascript: Section.select Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/select-method/llms-full.txt): Selects the section.

---

## Nearby

- **Previous:** [SaveUserDictionaryCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/saveuserdictionarycallback/llms-full.txt)
- **Next:** [Javascript: Section.format Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/section/format-property/llms-full.txt)
