# Javascript: TXTextControl.endUndoAction Method

> Ends a user-defined undo operation. All editing and fomatting changes made between beginUndoAction and endUndoAction belong to the undo operation. These changes are undone or redone in a single step.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TXTextControl.endUndoAction Method
- **368 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/endundoaction-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/endundoaction-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/endundoaction-method/llms-full.txt

---

### Description

Ends a user-defined undo operation. All editing and fomatting changes made between [beginUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/beginundoaction-method/llms-full.txt) and endUndoAction belong to the undo operation. These changes are undone or redone in a single step.

### Syntax

```javascript
<void> TXTextControl.endUndoAction([<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.endUndoAction` in a practical document-editing workflow. Ends a user-defined undo operation. All editing and fomatting changes made between beginUndoAction and endUndoAction belong to the undo operation. These changes are undone or redone in a single step.

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

TXTextControl.endUndoAction(
    function() {
        console.log("end undo action completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.editMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/editmode-property/llms-full.txt)
- **Next:** [Javascript: TXTextControl.FieldType Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/fieldtype-enumeration/llms-full.txt)
