menu element represents a toolbar that consists of a list of commands represented by an unordered list of items (
li elements). This element is simply a semantic alternative to the
ul element used to represent an unordered list of commands.
In the following example, we'll insert a toolbar menu that's pretending to be the menu bar in a text editor. The commands listed in this menu will lead to no action, but the example will still be sufficient to depict the functionality of the
menu element. As stated before, each item in the menu is represented by a list item (
li element) containing a
<menu> <li><button onclick="new()">New...</button></li> <li><button onclick="open()">Open...</button></li> <li><button onclick="save()">Save</button></li> <li><button onclick="saveas()">Save as...</button></li> </menu>
For information about global attributes refer to this list of global attributes in HTML5.
For information about global events refer to this list of global events in HTML5.