HTML <menu> labelAttribute
Example
A toolbar with two menu buttons ("File" and "Edit"), each button is a dropdown menu with a series of options:
<menu type="toolbar">
<li>
<menu label="File">
<button type="button" onclick="file_new()">New...</button>
<button type="button" onclick="file_open()">Open...</button>
<button type="button" onclick="file_save()">Save</button>
</menu>
</li>
<li>
<menu label="Edit">
<button type="button" onclick="edit_cut()">Cut</button>
<button type="button" onclick="edit_copy()">Copy</button>
<button type="button" onclick="edit_paste()">Paste</button>
</menu>
</li>
</menu>
<li>
<menu label="File">
<button type="button" onclick="file_new()">New...</button>
<button type="button" onclick="file_open()">Open...</button>
<button type="button" onclick="file_save()">Save</button>
</menu>
</li>
<li>
<menu label="Edit">
<button type="button" onclick="edit_cut()">Cut</button>
<button type="button" onclick="edit_copy()">Copy</button>
<button type="button" onclick="edit_paste()">Paste</button>
</menu>
</li>
</menu>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Currently, almost no mainstream browsers support the label attribute.
Definition and Usage
The label attribute specifies the visible label of a menu.
The label attribute is commonly used to display labels for menus nested within a menu.
Differences between HTML 4.01 and HTML5
In HTML5, the <menu> element was redefined, and the label attribute was added.
Syntax
<menu label="text">
Attribute Values
| Value | Description |
|---|---|
| text | Specifies the visible label of the menu. |
HTML <menu> Tag Other Extensions