HTML menu label attribute
Examples
A toolbar with two menu buttons ( "File" and "Edit"), and each button is a drop-down menu with a range 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"
Browser Support
There are few major browsers support the label property.
Definition and Usage
label attribute specifies the visible label of the menu.
label property is typically used to display the menu tab within nested menus.
Differences between HTML 4.01 and HTML5
In HTML5, redefined <menu> element and add the label attribute.
grammar
<menu label="text">
Property Value
值 | 描述 |
---|---|
text | 规定菜单的可见标签。 |
HTML <menu> tag