# GetChildIndexForId(int)

> Gets the child index under the parent of the item with the specified ID.

## Definition

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

```csharp
public int GetChildIndexForId(int id)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The item ID.

### Returns

| Type                                                       | Description                                                                                          |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The child index under the parent. Returns -1 if the item has no parent or doesn't exist in the tree. |
