# IndexOf(VisualElement)

> Retrieves the index of the specified VisualElement in the Hierarchy.

## Definition

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

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

### Parameters

**** (\[VisualElement]\(/engine/6000.0/script-reference/unityengine/uielements/visualelement)): The element to return the index for.

### Returns

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