HTML menu type property
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 type attribute.
Definition and Usage
type attribute specifies the type of the menu.
Differences between HTML 4.01 and HTML5
In HTML5, redefined <menu> element and add the type attribute.
grammar
<menu type="list|context|toolbar">
Property Value
值 | 描述 |
---|---|
list | 默认。规定一个列表菜单。一个用户可执行或激活的命令列表(li 元素)。 |
context | 规定一个上下文菜单。菜单必须在用户与命令进行交互之前被激活。 |
toolbar | 规定一个工具栏菜单。主动式命令,允许用户立即与命令进行交互。 |
HTML <menu> tag