---
url: /api/formats/interactions/src/functions/initMenu.md
---
[pantoken-root](../../../../index.md) / [formats/interactions/src](../index.md) / initMenu

# Function: initMenu()

> **initMenu**(`menu`, `trigger`): [`MenuHandle`](../interfaces/MenuHandle.md)

Wire a vertical, single-level ARIA menu and its native popover button.
Arrow keys wrap; Home/End and initial-character search move focus. Escape returns
focus to the button; Tab closes without canceling normal sequential navigation.
Applications own click actions and checked state. Space activates checkable items
without closing; Enter and pointer activation close unless the click is canceled.

## Parameters

### menu

`HTMLElement`

### trigger

`HTMLButtonElement`

## Returns

[`MenuHandle`](../interfaces/MenuHandle.md)
