# Javascript: InputPosition.scrollTo Method

> Scrolls the contents of a Text Control so that the current input position becomes visible.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: InputPosition.scrollTo Method
- **375 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/scrollto-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/scrollto-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/scrollto-method/llms-full.txt

---

### Description

Scrolls the contents of a Text Control so that the current input position becomes visible.

### Syntax

```javascript
<void> InputPosition.scrollTo(<InputPosition.ScrollPosition> scrollPosition, <EmptyRequestCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| scrollPosition | Specifies an InputPosition.ScrollPosition value. |
| callback | Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `InputPosition.scrollTo` in a practical document-editing workflow. It scrolls the contents of a Text Control so that the current input position becomes visible.

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

function scrollTo(scrollPosition) {
    TXTextControl.inputPosition.scrollTo(
        scrollPosition,
        function() {
            console.log("scroll to completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: InputPosition.ScrollPosition Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/scrollposition-enumeration/llms-full.txt)
- **Next:** [Javascript: InputPosition.setInactiveMarker Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/setinactivemarker-method/llms-full.txt)
