# IndexOf(VisualElement)

> Retrieves the child index of the specified VisualElement.

## Definition

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

```csharp
public int IndexOf(VisualElement element)
```

### Parameters

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

### Returns

| Type                                                       | Description                                              |
| ---------------------------------------------------------- | -------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the child, or -1 if the child is not found. |
