# ScrollTo(VisualElement)

> Scroll to a specific child element.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public void ScrollTo(VisualElement child)
```

### Parameters

**** (\[VisualElement]\(/engine/6000.0/script-reference/unityengine/uielements/visualelement)): The child to scroll to.

### Remarks

This example creates a ScrollView that contains multiple labels. A Button is used to scroll to a selected label.

### Examples

```csharp
using UnityEngine;
using UnityEngine.UIElements;

public class ScrollViewScrollToExample : MonoBehaviour
{
    public UIDocument uiDocument;
    public int numberOfLabels = 100;
    public int scrollToButton = 50;

    Label[] labels;

    void Start()
    {
        var sv = new ScrollView { name = "My Scroll View" };

        labels = new Label[numberOfLabels];
        for (int i = 0; i < numberOfLabels; i++)
        {
            var label = new Label { text = "Button " + i };
            labels[i] = label;
            sv.Add(label);
        }

        var button = new Button { text = "Scroll to " + scrollToButton };
        button.clicked += DoScrollTo;

        uiDocument.rootVisualElement.Add(button);
        uiDocument.rootVisualElement.Add(sv);
    }

    void DoScrollTo()
    {
        var sv = uiDocument.rootVisualElement.Q<ScrollView>("My Scroll View");
        sv.ScrollTo(labels[scrollToButton]);
    }
}
```
