html5 <menu>标签用于定义菜单列表。
两个菜单按钮系列选项实例("file" 和 "edit"):
<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>
目前主流浏览器并不支持 <menu> 标签。
注意: 这个元素在html4中被弃用,但再html5.1(正在起草中)中被重新推荐使用。
<menu> 标签定义了一个命令列表或菜单。
<menu> 标签通常用于文本菜单,工具条和命令列表选项。
提示: 使用 css 来定义菜单列表样式。
html 4.01的 <menu> 元素已废弃。
html5 中 <menu> 元素已被重新定义。
new:html5 新属性。
属性 | 值 | 描述 |
---|---|---|
labelnew | text | 描述菜单项的标记。 |
typenew | context toolbar list | 描述显示菜单类型. 默认为 "list"。 |
<menu> 标签支持全局属性,查看完整属性表 html全局属性。
<menu> 标签支持所有 html事件属性。