HTML Tag Reference - HTML tag <menu>








The <menu> tag marks a menu of commands.

The <menu> tag can be used for context menus, toolbars and for listing form controls and commands.

Browser compatibility

<menu> No No Yes No No

What's new in HTML5

The <menu> element is redefined in HTML5.

Attribute

Attribute Value Description
label text label for the menu
type popup
toolbar
context
Set type of menu to display




Global Attributes

The <menu> tag supports the Global Attributes in HTML.

Event Attributes

The <menu> tag supports the Event Attributes in HTML.

Default CSS Settings

menu {
    display: block;
    list-style-type: disc;
    margin-top: 1em;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
    padding-left: 40px;
}




Example

<!DOCTYPE html>
<html>
<body>
<!--  ww  w . ja  v  a2s  .com-->
<div style="background:red;border:1px solid black;" contextmenu="mymenu">
    <p>Right-click inside this box to see the context menu!
    
    <menu type="context" id="mymenu">
      <menuitem label="Refresh is added from menu"></menuitem>
    </menu>

</div>

</body>
</html>

Click to view the demo