menu

< html‎ | elements
Jump to: navigation, search

menu

This article is In Progress.


W3C Editor's Draft

Summary

The menu element represents information as a list of items or commands.


Overview Table

DOM Interface HTMLMenuElement

The menu element is used to define a list as a menu of commands. The menu element has two specific attributes as well as can accept global and event attributes in HTML.

The menu element is currently unsupported by major browsers.

Attributes

The menu element will specifically accept the label attribute whose value is text and the type attribute whose value can be context, toolbar, or list. list is the default value.

The menu element also accepts global attributes and event attributes.


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
?
Unknown
?
Unknown
?
Unknown
?
Unknown
?
Unknown

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Unknown
?
Unknown
?
Unknown
?
Unknown
?
Unknown

Examples

View live exampleThis is an example of the menu element using the type and label attributes as well as the button element.

HTML

<menu type="toolbar">
  • <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>
  • <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>
  • </menu>

    Usage

    The menu and ul both represent an unordered list of items. They differ in the way that the ul element only contains items to display while the menu element contains interactive items, to act on.


    Related specifications

    Specification Status Related Changes
    HTML 4.01 Deprecated
    DOM HTML Redifined

    See also

    Other articles

    Attribution

    This article contains content originally from external sources.

    Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]