# GetActiveOptions(Span<int>)

> Retrieves a Span of integers containing the active options as indices.

## Definition

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

```csharp
public Span<int> GetActiveOptions(Span<int> activeOptionsIndices)
```

### Parameters

**** (\[Span\<int>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): A Span of type integers with the allocated size to hold the number of active indices.

### Returns

| Type                                                               | Description |
| ------------------------------------------------------------------ | ----------- |
| [Span\<int>](https://learn.microsoft.com/dotnet/api/system.span-1) |             |

### Examples

```csharp
public void HandleActiveOptions()
{
    var value = myToggleButtonGroup.value;
    var options = value.GetActiveOptions(stackalloc int[value.length]);
    foreach (option in options)
    {
        // handle option
    }
}
```
