English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The label attribute specifies the visible label of the menu, the label attribute is usually used to display the nested menu labels within the menu.
A toolbar with two menu buttons ("File" and "Edit") each of which is a dropdown menu with a series of options:
<!DOCTYPE html> <html> <head> <title>HTML:<menu> label attribute - 基础教程网(oldtoolbag.com)</title> </head> <body> <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> <p><b>Attention:</b>Most mainstream browsers do not support the menu tag.</p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Currently, almost no mainstream browsers support the label attribute.
The label attribute specifies the visible label of the menu.
The label attribute is usually used to display the nested menu tags within the menu.
In HTML5 In HTML5, the <menu> element is redefined and the label attribute is added.
<menu label="text">
value | description |
---|---|
text | Specifies the visible label of the menu. |