HTML: <menu> tag
This HTML tutorial explains how to use the HTML element called the <menu> tag with syntax and examples.
Description
The HTML <menu> tag defines an unordered menu list in the HTML document. This tag is also commonly referred to as the <menu> element.
Syntax
In HTML, the syntax for the <menu> tag is:
<body>
<menu type="toolbar">
<li>
<menu label="File">
<button type="button" onclick="new()">New</button>
<button type="button" onclick="save()">Save</button>
</menu>
</li>
<li>
<menu label="Edit">
<button type="button" onclick="copy()">Copy</button>
<button type="button" onclick="paste()">Paste</button>
</menu>
</li>
</menu>
</body>
Attributes
In addition to the Global Attributes, the following is a list of attributes that are specific to the <menu> tag:
Attribute | Description | HTML Compatibility |
---|---|---|
context | Type of menu. It can be one of the following values: context, toolbar, list | HTML5 |
label | Menu label | HTML5 |
Note
- The HTML <menu> element is found within the <body> tag.
- The <menu> tag is made up of <li> tags.
- You can nest <ol>, <ul> and <menu> lists.
Browser Compatibility
The <menu> tag is not implemented in most browsers.
Example
We will discuss the <menu> tag below, exploring examples of how to use the <menu> tag in HTML5 and HTML 4.01.
Advertisements