Actions Menu Button Example Using aria-activedescendant
        This example demonstrates how the   
        menu button design pattern
      can be used to create a button that opens an actions menu.
      In this example, choosing an action from the menu will cause the chosen action to be displayed in the Last Action
 edit box.
    
This implementation uses aria-activedescendant to manage focus in the menu.
Similar examples include:
- Action Menu Button Example Using element.focus(): A button that opens a menu of actions or commands where focus in the menu is managed using element.focus().
- Navigation Menu Button: A button that opens a menu of items that behave as links.
Example
Keyboard Support
Menu Button
| Key | Function | 
|---|---|
| Down Arrow Space Enter | Opens menuand moves focus to firstmenuitem | 
| Up Arrow | Opens menuand moves focus to lastmenuitem | 
Menu
| Key | Function | 
|---|---|
| Enter | 
 | 
| Escape | 
 | 
| Up Arrow | 
 | 
| Down Arrow | 
 | 
| Home | Moves focus to the first menu item. | 
| End | Moves focus to the last menu item. | 
| A-Z a-z | 
 | 
Role, Property, State, and Tabindex Attributes
Menu Button
| Role | Attribute | Element | Usage | 
|---|---|---|---|
| aria-haspopup="true" | button | 
 | |
| aria-controls="IDREF" | button | 
 | |
| aria-expanded="true" | button | 
 | 
Menu
| Role | Attribute | Element | Usage | 
|---|---|---|---|
| menu | ul | Identifies the ulelement as amenu. | |
|  | aria-labelledby="IDREF" | ul | 
 | 
| tabindex="-1" | ul | 
 | |
| aria-activedescendant="IDREF" | ul | 
 | |
| menuitem | li | 
 | 
Javascript and CSS Source Code
- CSS: MenubuttonAction.css
- Javascript: Menubutton2.js
- Javascript: MenuItemActionActivedescendant.js
- Javascript: PopupMenuActionActivedescendant.js
HTML Source Code